I'm really new to android programming, in fact to programming itself. I'm creating an app that has tabs, and within one of the tab, i would like to add listview within it. I'm lost and stuck, pls advise
public class TabActivityQueue extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View V = inflater.inflate(R.layout.activity_tab_activity_queue, container, false);
populateListView();
return V;
}
private void populateListView() {
// Create list of items
String[] myItems = {"Blue", "Green", "Purple", "Red"}; // Build Adapter
// TODO: CHANGE THE [[ to a less than, ]] to greater than.
ArrayAdapter<String> adapter = new ArrayAdapter<String> (TabActivityQueue,R.layout.da_items, myItems);
ListView list = (ListView) findViewById(R.id.listview1);
list.setAdapter(adapter);
}}