I’m aware of the setListShown(false) and setListShown(true) issue when using the Compatibility Library with ListFragments, but how do I display a ListFragment regardless of this bug? My ArrayAdapter getView() method never fires for some reason…
Bug:
http://code.google.com/p/android/issues/detail?id=17096
DateAdapter.java
class DateAdapter extends ArrayAdapter<DateVO> {
//constructor
public DateAdapter(Context context) {
super(context, android.R.layout.simple_list_item_2);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Log.i("tag", "getView"); //never called
...
MyFragment.as
public class MyFragment extends ListFragment implements LoaderCallbacks<ArrayList<DateVO>> {
...
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
m_adapter = new DateAdapter(context);
setListAdapter(m_adapter);
//setListShown(false);
//initialize the loader
getLoaderManager().initLoader(0, null, this);
}
...
Ok, got this to load content from my custom loader… finally! And since setListShown(true|false) doesn’t work properly with the compatibility lib,
I simply created a custom ProgressDialog added via a DialogFragment. If you wish to see code just respond and I’ll post.