如何发送隐藏数据,意图适应listview并根据列表视图意图中的列表位置获取数据?

时间:2017-03-19 05:20:20

标签: java android listview android-intent jsoup

我正在开发一个从网页中检索数据的应用。它正在检索某些链接数据以及链接putExtra或地址。

现在我正在检索链接数据并打开一个新意图,并通过htmlDocument = Jsoup.connect(htmlPageUrl).get(); htmlContentInStringFormat = htmlDocument.select("table.c tbody > tr > td:nth-child(3) > a"); for (Element eachItem:htmlContentInStringFormat){ String bookList = eachItem.text().substring(0, 30); bookListArray.add(bookList); } 向其发送一个arraylist。在新意图中,我在列表视图中显示数据。

下面的代码检索数据并生成arraylist

Intent searchData = getIntent();
ArrayList<String> searchQuery = (ArrayList<String>)searchData.getStringArrayListExtra(MainActivity.SEARCH_DATA);


ArrayAdapter<String> bookListArrayAdapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, searchQuery);
setListAdapter(bookListArrayAdapter);

适应和显示列表视图的新意图

href

现在,我知道如何检索链接href的数据。但我需要将case x="Fin"的数据与数组中的每个列表项一起发送,但不会显示在列表中。但是当点击列表项时,根据列表位置或ID,应用程序将打开一个新意图,在webView中打开链接或检索一些新信息。

所以,我对我必须采取的步骤感到困惑。请帮帮忙。真的很感激。提前致谢。

0 个答案:

没有答案