android-listview

Update ListView Textview vom Asyntask

☆樱花仙子☆ 提交于 2019-12-25 02:47:06
问题 i need to update a textView from my asynctask. I have an custom adapter for the listview and there i want to have a countdown for each entry. I will start the asynctask for each entry from my Adapter. How can i update the textview each second from the asynctask? Thanks for help :) 回答1: If you post your code, I can give you a better answer. However, a common way to update views periodically is by using Handlers. private final Handler mHandler = new Handler(); //intialize in main thread public

JSOUP and ListView

喜你入骨 提交于 2019-12-25 02:44:14
问题 I'm building a personal app that, using JSOUP, puts the text of certain links into a ListView. For each link there should be a corresponding entry in ListView with the text from that link. When I run the app it successfully parses all of these texts. However, it places all of the text clumped up together in a single ListView entry then does the exact same thing over for consecutive entry. Where am I going wrong? Relevant code below: public class MainActivity extends Activity { public Elements

ListView with two items per row

五迷三道 提交于 2019-12-25 02:44:08
问题 I have a listview, and I want something like: row1: [ item 1 ] row2: [item2][item3] row3: [ item 4 ] row5: [ item 5 ] etc. So second and third item to be one next to each other, and other items are standard, one below the other. I tried to put two items in one row, but that's impossible. I saw this https://github.com/umano/MultiItemRowListAdapter, but it isn't helpful, 'cause I want just two items, others are standard. Also I tried to make gridview for just two items and listview for others,

AsyncTask, CustomBaseAdapter and Listview

爱⌒轻易说出口 提交于 2019-12-25 02:43:45
问题 I have a CustomBaseAdapter with which i fill certain fields: public ArrayList<SearchResults> GetSearchResults(){ ArrayList<SearchResults> results = new ArrayList<SearchResults>(); Document doc = Jsoup.parse(kpn); Elements tdsFromSecondColumn = doc.select("table.personaltable td:eq(0)"); Elements tdsFromSecondColumn1 = doc.select("table.personaltable td:eq(1)"); SearchResults sr1 = new SearchResults(); for (Element tdFromSecondColumn : tdsFromSecondColumn) { sr1 = new SearchResults(); sr1

Listview getting refreshed after scrolling the list in android

孤街浪徒 提交于 2019-12-25 02:39:06
问题 thanks in advance , please forgive me if I am mistaking somewhere when explaining the question I have a Listview and a custom ArrayAdapter and the layout for the custom ArrayAdapter is as follows. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true"

Set image dynamically in a listview by retrieving image name from a data source in android

喜你入骨 提交于 2019-12-25 02:37:31
问题 What is the best way to retrieve images from drawable folder while the name of those images are stored in a DB and show them in a listView ? Suppose i have three pictures in drawable folder and their names are stored in DB as: pic1.jpeg image2.jpeg another_image.jpeg I also have a method called getAllimages() where i retrieve image names and return them as a Cursor from DB: public Cursor getAllImages(){ String sql = "SELECT iId as _id," + COLUMN_IMG_DESC + "," + COLUMN_IMG_NAME + " FROM " +

OnItemClick doesnt work if there is ScrollView on layout

拜拜、爱过 提交于 2019-12-25 02:29:13
问题 I have a ListView and here is its row layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="280dp"> <ScrollView android:scrollbars="none" android:focusable="false" android:focusableInTouchMode="false" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/exploreImage" android:src="@drawable/beard1" android:adjustViewBounds="true" android:layout_width="match

Spinner selection not working Android

*爱你&永不变心* 提交于 2019-12-25 02:26:07
问题 I have a listView with n number of rows each row contains textview1(for text), textview2(For id) and spinner. I want to select spinner in multiple rows. Here the problem is once i scroll the listView the selection is gone (Recycle listView). I have store the id in a ArrayList(Which rows spinner selected) and selected position of the spinner. In onScroll method of listView i try to use spinner.setSelection(position); but it won't work. My sample image And my source code: level2

Custom List Adapter not Binding values to TextView

你。 提交于 2019-12-25 02:26:03
问题 I'm trying to create an android list using a custom adapter and the following XML row layout. I have implemented the following classes however when I run it onto my emulator the "android:id="@+id/firstLine" TextView does not appear to be setting the text! The "id/secondLine" Text View does receive the correct text! List Row Item XML Layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"

Null Pointer exception on layout inflator

本小妞迷上赌 提交于 2019-12-25 02:25:41
问题 I am trying to add listview to my layout from a class which extends fragments. The problem is, when the data is coming, the layout is showing null pointer exception. Here is the code: TopStoriesFragment.java public class TopStoriesFragment extends Fragment { public String thehindu = "http://www.thehindu.com/news/?service=rss"; public String toi = "http://timesofindia.feedsportal.com/c/33039/f/533965/index.rss"; public String reuters = "http://feeds.reuters.com/reuters/topNews"; public String