FileDocCategorySizeDatePackage
AppListFragment.javaAPI DocAndroid 5.1 API4516Thu Mar 12 22:22:44 GMT 2015com.example.android.musicbrowserdemo

AppListFragment

public class AppListFragment extends android.support.v4.app.ListFragment

Fields Summary
private Adapter
mAdapter
private List
mItems
Constructors Summary
public AppListFragment()

    
Methods Summary
public voidonActivityCreated(android.os.Bundle savedInstanceState)

        super.onActivityCreated(savedInstanceState);
        mAdapter = new Adapter();
        setListAdapter(mAdapter);
    
public voidonListItemClick(android.widget.ListView l, android.view.View v, int position, long id)

        final Item item = mItems.get(position);

        Log.i("AppListFragment", "Item clicked: " + position + " -- " + item.component);

        final BrowserListFragment fragment = new BrowserListFragment();

        final Bundle args = new Bundle();
        args.putParcelable(BrowserListFragment.ARG_COMPONENT, item.component);
        fragment.setArguments(args);

        getFragmentManager().beginTransaction()
                .replace(android.R.id.content, fragment)
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                .addToBackStack(null)
                .commit();