android-listview

ListActivity doesn't update as data arrives

大城市里の小女人 提交于 2019-12-22 08:57:43
问题 I'm building a small application that I'd like to automatically update when new data arrives. From what I've read of the android documentation, I thought that because I'm using the newer techniques that a ContentObserver would be created in the background for me, and I would just get automatic calls to the Loader. If there's any more information that would be helpful, I'd be glad to add it, or to upload the complete project somewhere. Additionally, I'm targeting KitKat (sdk version 19).

How to expand and collapse an item in listview

亡梦爱人 提交于 2019-12-22 08:26:39
问题 I am pretty new to android. I want to implement a list view. It contains some list items and when they are clicked, they should expand showing more information. But I unable to find a way to do that Here is my activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/listview1" android:layout_width="match_parent

Change ListView's ScrollBar/FastScroll color?

♀尐吖头ヾ 提交于 2019-12-22 05:32:04
问题 My app has an orange theme all over but the ScrollBar/FastScroll is appearing green. I've tried to search a lot but can't find any way to change this. It just stays the way it is. I found a "android:fastScrollTextColor" property but that changes the color of the B inside the bubble. And I can't find any property to change the color of this bubble or the ScrollBar next to it. In case it makes a difference I'm using the custom PinnedHeaderListView that I got from here to mimic the sticky

Focus not working as expected in ListView

梦想与她 提交于 2019-12-22 05:20:08
问题 I am developing an accessible app. For this purpose it is important that all elements of the interface can obtain the focus correctly, so that they can be read by Talckback. I build a PreferenceActivity with a ListView inside, like in this question Preference List only shows first element It works perfect in touch mode, but when I try to access to the ListView with the Talckback activated (It's like I try to get Focused the ListView ), It doesn't work like I expected. I want the children of

Android: ScrollView is not scrolling

こ雲淡風輕ζ 提交于 2019-12-22 04:59:12
问题 I am trying to create a layout with a header, a banner below it, and then a couple of ListView under the banner. I want the the complete screen to be scrollable except the header. Now I know that ListView does not scroll within a ScrollView so I have set the height of the ListView big enough to show all the items. The problem is that, even after these changes, I see that the ListView is scrolling independently and the complete screen is not scrollable. ` <include android:id="@+id/logo_header"

ViewPager within ListView row item

£可爱£侵袭症+ 提交于 2019-12-22 04:39:22
问题 I have read a lot of related questions regarding this question. However, none of them has been answered. I am trying to add a ViewPager to each row in the ListView where there are two layouts within the pager. I believe this is doable because of SwipeListView . Now I have implemented it. However, a blank page is showing with a line in the middle. No rows are appearing. Here is my code: MainActivity + ArrayAdapter public class MainActivity extends Activity { ListView list; String[] heros;

Retrieving the selected items from a multi-select ListView

微笑、不失礼 提交于 2019-12-22 01:36:21
问题 I am currently implementing a multi-select ListView for my android app. My aim is to retrieve the selected items from the ArrayAdapter associated with the ListView when clicking the search button. I am currently stumped on how to do this, I have found stuff online such as trying to set a MultiChoiceModeListener , but this does not seem to come up as an option in Eclipse . I am using Google API s(level 10), Android 2.3.3 equivalent. Here is the code I have so far: public class FindPlace

How to show json response in other activity?

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:31:15
问题 I am creating one application,in my application I am using json parsing,I am sending request to server for after click on button request will be send,and i will get response {"searchresult": [ {"match_detail_id":369,"profile_id":"GM686317","name":"Sonal Patel","image":"","location":"Rajkot ,Gujarat ,India","mothertongue":"Gujarati","religion":"Hindu","occupation":"Professor \/ Lecturer","education":"Masters - Arts\/ Science\/ Commerce\/ Others"} , {"match_detail_id":396,"profile_id":"GM780609

Android - Populating a listview using fragments and a Simple cursor adapter

谁说我不能喝 提交于 2019-12-22 00:48:39
问题 I know that this question is probably asked a hundred times so far, but i still haven't manage to solve my problem. I have one activity that's comprised of 2 fragments. One fragment is a form that adds information to the database: **R.layout.fragment_add_server:** <?xml version="1.0" encoding="utf-8"?> ... <LinearLayout android:id="@+id/nameLinear" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginLeft="5dp" >

Using radio button in custom listview in Android

旧街凉风 提交于 2019-12-22 00:36:08
问题 I have a custom listview which is done with getView. It must be 4 textview and a radiobutton on the right in each row. I saw many examples about this here but couldn't get the idea. Here is my getView function. With this situation i can see the rows but radiobuttons are still checked when i choose another radiobutton. What should i have to add to the function to make radiobuttons work properly and get Id of the selected one? Thanks private static class CitizenAdapter extends BaseAdapter {