Code example for ListFragment

Methods: getActivity, getArguments, onCreate

    private ListView mListView;
    /** Called when the activity is first created. */ 
    public void onCreate(Bundle savedInstanceState) {
        // Get a handle on our containing activity. 
        mParentActivity = this.getActivity();
        // Create our adapter. 
        mAdapter = new ArrayAdapter<GroupData>(mParentActivity, android.R.layout.simple_list_item_1, mGroupList);
        // Load our sort type from the arguments. 
        if (getArguments() != null && getArguments().containsKey("sort")) {
            mSortType = getArguments().getString("sort");
        // Load the first set of groups. 
        new GetUserGroupsTask().execute();
Experience pair programming with AI  Get Codota for Java