Multi MarkdownView File

Viewed 35

I have a listview of topics all contents are from MarkDown I'm having a problem changing the markdown every click of the item in the listview

 if (position == 0) {
        Intent intent = getIntent();
        Bundle bundle = this.getIntent().getExtras();
         aTitle = intent.getStringExtra("title");
        actionBar.setTitle(aTitle);
        markdownView.loadMarkdownFile(BASE, "file:///android_asset/Objects.md", STYLES, SCRIPT);
    }else if (position == 1){
        Intent intent = getIntent();
        Bundle bundle = this.getIntent().getExtras();
        aTitle = intent.getStringExtra("title");
        actionBar.setTitle(aTitle);
        markdownView.loadMarkdownFile(BASE, "file:///android_asset/les2.md", STYLES, SCRIPT);
    }
1 Answers

I put the link in putExtra at the first activity and it works

 if (position == 0) {
        Intent intent = getIntent();
        Bundle bundle = this.getIntent().getExtras();
         aTitle = intent.getStringExtra("title");
         lessons = intent.getStringExtra("lessons");
        actionBar.setTitle(aTitle);

        if (markdownView != null)
        {
            markdownView.loadMarkdownFile(BASE, lessons, STYLES, SCRIPT);
            WebSettings settings = markdownView.getSettings();
            settings.setBuiltInZoomControls(true);
            settings.setDisplayZoomControls(false);
        }

    }else if (position == 1){
        Intent intent = getIntent();
        Bundle bundle = this.getIntent().getExtras();
        aTitle = intent.getStringExtra("title");
        lessons = intent.getStringExtra("lessons");
        actionBar.setTitle(aTitle);
        if (markdownView != null)
        {
            markdownView.loadMarkdownFile(BASE, lessons, STYLES, SCRIPT);
            WebSettings settings = markdownView.getSettings();
            settings.setBuiltInZoomControls(true);
            settings.setDisplayZoomControls(false);
        }
    }
Related