Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将html文件添加到ListView中,以及如何在android中使用putExtra? Html.fromHtmlwebView;如何做到这一点?如果条件仅使用意图,则无需使用。putExtraselectedWebView,webView[posi_Android - Fatal编程技术网

如何将html文件添加到ListView中,以及如何在android中使用putExtra? Html.fromHtmlwebView;如何做到这一点?如果条件仅使用意图,则无需使用。putExtraselectedWebView,webView[posi

如何将html文件添加到ListView中,以及如何在android中使用putExtra? Html.fromHtmlwebView;如何做到这一点?如果条件仅使用意图,则无需使用。putExtraselectedWebView,webView[posi,android,Android,如何将html文件添加到ListView中,以及如何在android中使用putExtra? Html.fromHtmlwebView;如何做到这一点?如果条件仅使用意图,则无需使用。putExtraselectedWebView,webView[position];但它不起作用,我是这样做的,但是。。。 final String[] webView = {"file:///assets/Test.html","file:///assets/Test1.html"}; listView.setO

如何将html文件添加到ListView中,以及如何在android中使用putExtra?
Html.fromHtmlwebView;如何做到这一点?如果条件仅使用意图,则无需使用。putExtraselectedWebView,webView[position];但它不起作用,我是这样做的,但是。。。
final String[] webView = {"file:///assets/Test.html","file:///assets/Test1.html"};
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        if(position==0)
        {
            Intent intent = new Intent(Theme1.this,Result_Theme.class);
            intent.putExtra("th0",webView[0]);
        }
        if(position==1)
        {
            Intent intent = new Intent(Theme1.this,Result_Theme.class);
            intent.putExtra("th1",webView[1]);
        }
    }
});
final String[] webView = {"file:///assets/Test.html","file:///assets/Test1.html"};
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        if(position==0)
        {
            Intent intent = new Intent(Theme1.this,Result_Theme.class);
            intent.putExtra("th0",Html.fromHtml(webView[0]));
        }
        if(position==1)
        {
            Intent intent = new Intent(Theme1.this,Result_Theme.class);
            intent.putExtra("th1",Html.fromHtml(webView[1]));
        }
    }
});