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

Custom arrayAdapter with listFragment

I'm trying to make a ListFragment. I looked the Api Demo (FragmentLayout). it works on a simple example and now i want to apply it to my existing project. Here is my code. I create inner classes (RecipeList & RecipeDetail) as in the Api…
-1
votes
2 answers

Attempting to create ListFragment crashes

I'm trying to add a ListFragment to an Activity in Gingerbread, but Android crashes when the Activity is created and there is no stack trace. I have verified that I'm using the compatibility library imports. Here is my code for the…
NLam
  • 451
  • 1
  • 9
  • 22
-2
votes
1 answer

Keeping track of a fragment in the activity

in my app there's an Activity with a Navigation Drawer. The selection of the drawer's items brings to the instantiation of related List Fragments. When I select an item in the List Fragment, a second Activity begins showing information about the…
-2
votes
4 answers

check box unchecked issue when i scroll the custom listview android

listview row having multiple checkboxex, when i checked the checkboxex then if i scroll the listview, its automatically unchecked the checkboxes. how can fix this issue. here is my getView method public View getView(final int position, View…
-2
votes
2 answers

How to show alert dialog for certain list item

I'm trying to show an alert dialog whenever I select a particular list item whereas the others would open a new fragment. However after inserting the alreat dialog code, an error is then returned. I don't understand why I'm getting this error when…
SD826E
  • 6,673
  • 7
  • 45
  • 92
-2
votes
1 answer

Retrieving the selected item in ListFragment

I've got a ListFragment with a couple items. I'm trying to implement a longclick to select an item for some action (edit/delete). Here is what I have in the ListFragment. public void onStart() { super.onStart(); …
borring
  • 69
  • 7
-2
votes
1 answer

Strings not being assigned to list view items

I am trying to use some strings from the strings.xml file for names of items for my list view but during deployment, my app won't run. I've looked in many areas of the Internet for relevant tutorials but all of them just show strings that have been…
SD826E
  • 6,673
  • 7
  • 45
  • 92
-2
votes
2 answers

how to add a custom listView to a fragment?

i'm trying to a custom listview in my fragment but getting a null-pointer error, how can i fix this.. i'm a beginner. listmain.xml:
-2
votes
3 answers

How do I refer to two listviews in the same layout with @android:id/list?

I am trying to set two different adapters on two listviews in the same layout. After a few searches on the internet and this error "must have a listview whos id must be android.R.id.list", I have found out I need to define my listview id as…
-2
votes
3 answers

onItemClickListener in ListView not working

I have a ListView within a ListFragment, and currently I just want a click on any of the items to go to ProblemActivity.class, which is currently a barebones 'HelloWorld' activity. Problem is I don't think the onItemClickListener is firing, and I'm…
-2
votes
1 answer

non-empty constructor issue

i have tried to make a non empty constructor but with no success. the eclipse says : From the Fragment documentation: Every fragment must have an empty constructor, so it can be instantiated when restoring its activity's state. It is strongly…
-2
votes
1 answer

scrolling listfragment not fluent with photo

i have a listfragment whith users photo. When i scroll my list it is slow. Then i load my photo async: public class UserArrayAdapter extends ArrayAdapter{ . . . @Override public View getView(int position, View convertView, ViewGroup parent)…
-3
votes
1 answer

Admob integration with AppCompatActivity

I am struggling to add admob to my application which is based on AppCompatActivity. I have tried several ways like autogenerated way (admob) some how not succeed. Below is the main activity class for reference. public class WorldClockActivity…
Biswajit Das
  • 594
  • 6
  • 22
-3
votes
1 answer

When I scroll down it always loads more the same data

Can anyone help me out? I want to load more data when scrolling up and down by using AsyncTask. I tried to use this below code but it loads only more 10 data when I scroll down besides that, it displays the same data. it doesn't load new data. Here…
-3
votes
2 answers

java.lang.NullPointerException: Attempt to get length of null array in my code

I have a login page. If the user successfully logs in, a new Activity should be started containing a ListFragment that contains user's private projects. I loop through all the project titles (from the json result I get) and store it in an array. And…
1 2 3
78
79