Code example for Fragment

Methods: getActivity, getArguments

0
        return getArguments().getString("title");
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        Bundle args = getArguments();
 
        mIntents = args.getParcelableArrayList("intents");
        mListView = new IntentListView(getActivity());
        mListView.setIntents(mIntents);
        if (mScrollIndex != -1 && mScrollTop != -1)
            mListView.setSelectionFromTop(mScrollIndex, mScrollTop);
        mListView.setOnScrollListener(this);
        mListView.setOnItemClickListener(this);
 
        return mListView;
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
    {