Shadow Separator Between Android Fragments

Just to let everyone know (because there seems to be a lack of information out there on this topic), this is achieved within the background selector XML of the individual list rows’ view. For example, this is the main screen’s layout, <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/list_row” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”vertical” android:background=”@drawable/list_item_selector”> …<!– Rest of layout goes here –> … Read more

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

You are not using the right implementations of CursorLoader and Loader. Remove your old imports and use these ones: import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.support.v4.widget.CursorAdapter; But I have the same Problem using SherlockActionBar: As I have to extend SherlockListActivity there is NO method getSupportLoadManager(). Any ideas on this? EDIT: follow this tutorial if … Read more

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

The definition of getChildFragmentManager() is: Return a private FragmentManager for placing and managing Fragments inside of this Fragment. Meanwhile the definition of getFragmentManager() (or in this case getSupportFragmentManager()) is: Return the FragmentManager for interacting with fragments associated with this fragment’s activity. Basically, the difference is that Fragment’s now have their own internal FragmentManager that can … Read more

Update data in ListFragment as part of ViewPager

Barkside’s answer works with FragmentPagerAdapter but doesn’t work with FragmentStatePagerAdapter, because it doesn’t set tags on fragments it passes to FragmentManager. With FragmentStatePagerAdapter it seems we can get by, using its instantiateItem(ViewGroup container, int position) call. It returns reference to fragment at position position. If FragmentStatePagerAdapter already holds reference to fragment in question, instantiateItem just … Read more