Code example for ListFragment

Methods: getActivity, onListItemClick, startActivity

0
        } 
    } 
 
    @Override 
    public void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);
        mExampleId = position;
        showSecondFragment(); 
    } 
 
    private void showSecondFragment() { 
        if (mDualPane) {
            mCallback.onFragmentUpdate(mExampleId, false);
        } else { 
            Intent intent = new Intent(getActivity(), SecondActivity.class);
            intent.putExtra("mExampleId", mExampleId);
            startActivity(intent);
        } 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {