Code example for ListFragment

Methods: setArguments

0
    public static ContentRowListFragment newInstance(Uri uri) {
        Bundle args = new Bundle(2);
        args.putString(ARG_URI, uri.toString());
 
        ContentRowListFragment frag = new ContentRowListFragment();
        frag.setArguments(args);
        return frag;
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getActivity().setTitle(getArguments().getString(ARG_URI));
        adapter = new ContentAdapter(getActivity());
    } 
 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setListAdapter(adapter);
        setListShown(false);