Questions tagged [android-listfragment]

ListFragment is one of the specialized Fragment classes which has, by default, a ListView as its content view.

ListFragment is one of the specialized Fragment classes which has, by default, a ListView as its content view. The ListFragment can be customized as desired but a ListView with the id android.R.id.list(or android:id="@android:id/list" for an xml layout) must be present in the content view used for the ListFragment. The methods that are present in a ListActivity (like getListView() and setListAdapter()) are available in a ListFragment.

More information about the ListFragment can be found in its documentation.

1175 questions
187
votes
5 answers

How many Activities vs Fragments?

Intro: The basic "Fragments Tutorial" pattern goes something like this: On a tablet, have a list on the left, details on the right. Both are Fragments and both reside in the same Activity. On a phone, have a list Fragment in one Activity.…
Richard Le Mesurier
  • 27,993
  • 19
  • 127
  • 242
142
votes
10 answers

Update data in ListFragment as part of ViewPager

I'm using the v4 compatibility ViewPager in Android. My FragmentActivity has a bunch of data which is to be displayed in different ways on different pages in my ViewPager. So far I just have 3 instances of the same ListFragment, but in the future…
81
votes
3 answers

What is difference between getSupportFragmentManager() and getChildFragmentManager()?

My class inherits Fragment and that's why it can't use getSupportFragmentManager(). I am using getChildFragmentManager and it is showing me Error - IllegalArguementException: No view found for id... error. Any guidance would be appreciated. Code…
NinjaCoder
  • 2,202
  • 3
  • 21
  • 44
65
votes
19 answers

getLoaderManager().initLoader() doesn't accept 'this' as argument though the class (ListFragment) implements LoaderManager.LoaderCallbacks

I'm having trouble following a guide on using SQLite in Android. I'm using a ListFragment instead of a ListActivity(as in the example), so I have the ListFragment implement LoaderManager.LoaderCallbacks instead. Then, in the fillData()…
vurp0
  • 1,025
  • 2
  • 9
  • 13
37
votes
2 answers

Shadow Separator Between Android Fragments

I have a layout similar to the ICS Gmail app for tablets (ListFragment on the left and content on the right) and I was wondering how I could go about constructing the layouts such that there is a shadow separator between the two fragments (like in…
user766650
27
votes
7 answers

Error inflating class fragment - duplicate id/illegalargumentexception?

I'm trying make an app that I'm building take a search term from the main activity, return results, and then have the results be clickable such that a detail could be viewed from each results. I'm doing this by using a MainActivity, a…
user2163853
  • 889
  • 4
  • 14
  • 24
21
votes
7 answers

Android refresh a fragment list from its parent activity

I have a main activity which contains the action bar with 3 menu buttons in it. I then have a fragment within this main activity which has a list. I would like to be able to refresh the list in the fragment from the main activity, when one of the…
user1319668
  • 329
  • 1
  • 3
  • 16
15
votes
5 answers

Fragment already active - When trying to setArguments

I am using the example give in the below link http://android-er.blogspot.in/2013/04/handle-onlistitemclick-of-listfragment.html Here i have two classes one extending List Fragment and other extending Fragment. Now i am passing object to…
Goofy
  • 5,990
  • 17
  • 83
  • 152
15
votes
4 answers

ListFragment onItemClickListener not working

I'm using the tabbed layout (with swipe). Here I have 3 tabs with controlled by a SectionsPagerAdapter. Each tab is a ListFragment. Now I want to get an event fired when one of the items in the list is clicked. I would like a listener for each…
dthomasen
  • 764
  • 13
  • 30
15
votes
1 answer

Fixed and always visible footer below ListFragment

I'm trying attach a footer, that is fixed and always visible, to the bottom of a ListFragment. I'm currently doing it like this: @Override public void onActivityCreated(Bundle savedInstanceState) { // ... adapter = new…
gcl1
  • 3,970
  • 11
  • 36
  • 55
13
votes
1 answer

Using Contextual action bar with fragments

I am currently working on android project and making use of fragments and ListViews/ListFragments. I have contextual action bars working on standard activities such as a ListActivity. Now I am trying to do the same sort of thing but on a fragment…
Boardy
  • 31,944
  • 94
  • 238
  • 411
12
votes
5 answers

Custom adapter getview is not called

I have a Custom adapter with a ListFragment but the adapters getView() is not getting called at all. This is how the adapter looks like - public class ModuleListItemAdapter extends BaseAdapter { List list; Context context; …
Akilan
  • 852
  • 1
  • 6
  • 19
11
votes
2 answers

Android Layout - layoutweight and weightsum

I need to build a layout with the set of linear layouts. The layout has to occupy a defined percentage of the screen. I need to do this to have a similar look in all the devices. Issue: I have a textview in the top right layout (green color box ).…
iappmaker
  • 2,833
  • 7
  • 30
  • 72
11
votes
3 answers

commit fragment from onLoadFinished within activity

I have an activity which loads a data list from the server using loader callbacks. I have to list out the data into a fragment which extends SherlockListFragment i tried to commit the fragment using Fragment newFragment =…
10
votes
2 answers

Android List view layout Similar to Google play

I want to implement a List layout similar to Google Play which have menu for every individual Row. Please help me to create this. Do I need to create a Popup Menu or there is any option available to achieve this. Thanks
1
2 3
78 79