Below is my code which displays data in listview which is parses from json.
I want to start new activity when the user clicks on any item in the list.
I followe
You start an activty with startActivity(intent);
You set the OnClickListner on your ListView which is not included in your code so Im implying:
OnItemClickListener listener = new OnItemClickListener (){
@Override
onItemClick(AdapterView> parent, View view, int position, long id){
String name = ((TextView) view.findViewById(R.id.txtText)).getText();
Intent intent = new Intent(context,WhatEverYouWant.class);
intent.putExtra("name",name);
startActivity(intent);
}
}
ListView listView = getView().findViewById(R.id.listview);
listView.setOnItemClickListener (listener);