Code example for ListFragment

Methods: getActivity, startActivity

0
 
    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) {
        super.onSaveInstanceState(outState);
        outState.putInt("mExampleId", mExampleId);
    } 
}