Code example for FragmentActivity

Methods: findViewById

0
        populateViews(); 
    } 
 
    private void populateViews() { 
        ListView listView = (ListView) findViewById(android.R.id.list);
        listView.setOnItemClickListener(this);
        listView.setOnItemLongClickListener(this);
 
        mListAdapter = new SampleListAdapter(this);
        listView.setAdapter(mListAdapter);
 
        populateAdapter(); 
    } 
 
    private void populateAdapter() { 
        mListAdapter.setNotifyOnChange(false);
 
        mListAdapter.add(new Sample(R.string.home_person_list_title,
                R.string.home_person_list_description, PersonListActivity.class)); 
        mListAdapter.add(new Sample(R.string.home_city_list_title,
                R.string.home_city_list_description, CityListActivity.class));