use of android.support.v4.app.ListFragment in project android_frameworks_base by crdroidandroid.
the class ShadowGridActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentById(android.R.id.content) == null) {
ListFragment listFragment = new NoDividerListFragment();
listFragment.setListAdapter(new ArrayAdapter<>(this, R.layout.card_row, R.id.card_text, TextUtils.buildSimpleStringList()));
fm.beginTransaction().add(android.R.id.content, listFragment).commit();
}
}
use of android.support.v4.app.ListFragment in project platform_frameworks_base by android.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String path = intent.getStringExtra(EXTRA_PATH);
if (path == null) {
path = "";
} else {
// not root level, display where we are in the hierarchy
setTitle(path);
}
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentById(android.R.id.content) == null) {
ListFragment listFragment = new TestListFragment();
listFragment.setListAdapter(new SimpleAdapter(this, getData(path), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
fm.beginTransaction().add(android.R.id.content, listFragment).commit();
}
}
use of android.support.v4.app.ListFragment in project platform_frameworks_base by android.
the class ShadowGridActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentById(android.R.id.content) == null) {
ListFragment listFragment = new NoDividerListFragment();
listFragment.setListAdapter(new ArrayAdapter<>(this, R.layout.card_row, R.id.card_text, TextUtils.buildSimpleStringList()));
fm.beginTransaction().add(android.R.id.content, listFragment).commit();
}
}
use of android.support.v4.app.ListFragment in project platform_frameworks_base by android.
the class CompatListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentById(android.R.id.content) == null) {
ListFragment listFragment = new ListFragment();
listFragment.setListAdapter(createListAdapter());
fm.beginTransaction().add(android.R.id.content, listFragment).commit();
}
}
use of android.support.v4.app.ListFragment in project Android-Group-39 by Area51TrainingCenter.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final FragmentManager fragmentManager = getSupportFragmentManager();
final ListFragment listFragment;
if (savedInstanceState == null) {
listFragment = new ListFragment();
fragmentManager.beginTransaction().replace(R.id.fragment_container, listFragment, TAG_FRAGMENT_LIST).commit();
} else {
listFragment = (ListFragment) fragmentManager.findFragmentByTag(TAG_FRAGMENT_LIST);
}
listFragment.setOnNoteSelectedListener(this);
}
Aggregations