Code example for ListFragment

Methods: getActivity, startActivity

0
    public void onListItemClick(ListView l, View v, int position, long id) {
 
        switch(position){
 
        case 0: 
            intent = new Intent(getActivity(), MainScreen.class);
            startActivity(intent);
            break; 
 
        case 1: 
            intent = new Intent(getActivity(), RestaurantMenuList.class);
            startActivity(intent);
            break; 
 
        case 2: 
            intent = new Intent(getActivity(), LocationHours.class);
            startActivity(intent);
            break; 
 
        case 4: 
            intent = new Intent(getActivity(), AboutPage.class);
            startActivity(intent);
            break;    
             
        case 3: 
            intent = new Intent(getActivity(), LoginWatcard.class);
            startActivity(intent);
            break;   
             
        default: 
 
        }