Code example for ListFragment

Methods: getListViewonListItemClick, getActivity, startActivity

0
	} 
 
	@Override 
	public void onListItemClick(ListView listView, View view, int position,
			long id) {
		super.onListItemClick(listView, view, position, id);
		String itemText = getListView().getItemAtPosition(position).toString();
		if(itemText.equals("+")){
		    Table table = ((EzServe) getActivity().getApplication()).getTable(currentTable);
		    Seat seat = new Seat(table.getNumSeats(), table);
		    table.addSeat(seat);
		    Intent intent = new Intent(getActivity(), SeatListActivity.class);
		    intent.putExtra("tableNumber", currentTable);
		    startActivity(intent);		    
		} 
		else{ 
    		Integer seatNum = 0;
    		if(itemText.toLowerCase().contains("seat")){
    			seatNum = Integer.parseInt(itemText.split(" ")[1]);
    		} 
Stop searching for code, let great code find you!  Add Codota to your java IDE