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
10
votes
1 answer

ListFragment "content view not yet created" on Rotate

I have an extended ListFragment, with this onViewCreated() public void onViewCreated(View v,Bundle savedInstanceState) { super.onViewCreated(v, savedInstanceState); mListener.onFragmentAction(0x000A); if (mAdapter != null) { …
nexus_2006
  • 745
  • 1
  • 11
  • 29
10
votes
1 answer

Populate list of custom view using ListFragment

I am trying to show elements in a list view using Fragments. I created my custom view as follow graphical representation of list_row.xml list_row.xml
10
votes
3 answers

ListView shows empty message briefly before data is loaded

I've created a ListFragment using the following custom layout which adds a TextView to show a message when the list is empty:
Jon
  • 391
  • 4
  • 8
9
votes
2 answers

Android: ListFragment: How to refresh list

I have a list view which is shown on a fragment. I have a button at the bottom of the screen in which when pressed, will call a webservice to reteive any additional data. If there is additional data, I need to add it to the list view. I have…
Martin Shinks
  • 505
  • 2
  • 5
  • 10
9
votes
5 answers

Duplication of listview rows in list fragment on orientation change

I have a ListFragment where I use a custom adapter to populate the listview. All is well until I change orientation and scroll. Then it looks like this: I am guessing it has something to do with me fumbling with a view holder, but I can't access…
Qw4z1
  • 2,949
  • 1
  • 22
  • 35
9
votes
7 answers

Highlight selected item in "ListFragment"?

I have posted the same problem a couple of times but it hasn't yet been resolved. I have a ListFragment and I want to highlight the selected item in the list. I have been given suggestions to use a "selector". I don't understand how to use this…
9
votes
1 answer

Custom ArrayAdapter in a ListFragment

I'm trying to create a custom ArrayAdapter to use for my ListFragment. Right now nothing is being displayed in the ListFragment except for the TextView saying what Fragment number it is. I have put a breakpoint in getView() method of my adapter…
8
votes
4 answers

How to execute action after DialogFragment positive button clicked

I created the following DialogFragment deriving it from the Android documentation: public class PayBillDialogFragment extends DialogFragment{ @Override public Dialog onCreateDialog(Bundle savedInstanceState){ final Bundle b =…
Raffo
  • 1,570
  • 5
  • 22
  • 41
8
votes
1 answer

Lifecycle of a replaced ViewPager and BackStack?

I'm really messed up with the android ViewPager's lifecycle, and I'm starting to think that there something wrong in the structure of my app. So I would like a confirmation if I can do the following : I have an application showing some tabs. One of…
8
votes
2 answers

getSupportLoaderManager() use same ids in different fragments?

I am making a viewPager in a FragmentActivity with multiple ListFragments. In order to populate the different listviews i get the LoaderManager and initiliaze in the loader. I wanted to have a unique LoaderManager for each fragment, however,…
8
votes
1 answer

Android ImageView does not match_parent inside FrameLayout below GingerBread

I am trying to build a speech bubble for a chat room. Each of the speech bubbles has the attached xml layout.  I am achieving this by setting the textView to wrap_content, the speech bubble imageView to match_parent and the frame_layout to…
7
votes
2 answers

background color of list become white in scrolling when using android.support.v4.app.ListFragment;

I'm facing a critical problem. I'm trying to change background color (transparent) of list in scrolling time but unable to do it. I tried to change is by xml of listView as well as by code too. but in both condition list background become white. I'm…
7
votes
3 answers

MultiChoiceModeListener causing issues with SherlockListFragment

So, I was reading this earlier question for ideas on how to allow me to click an item in a list to do one action or long-press that item to switch to an ActionMode where I can select multiple items and use the ActionBar to do something to those…
6
votes
1 answer

Creating custom simple cursor adapter

I want to create a very simple cursor custom cursor adapter to facilitate changing the colors of row items on click. Using the following code private static int save = -1; public void onListItemClick(ListView parent, View v, int position, long id)…
6
votes
3 answers

How to implement right swipe in ListFragment with Custom Item Adapter?

What I need is to detect the right swipe of the item and display some activity. I did prev. investigation but it not seems to obvious to catch correct solution. Please, help me. My code is following. public class FragmentTwo extends ListFragment …
DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458
1
2
3
78 79