1
I’m working on my first project with ListFragment
searching the internet in tutorials and even in the online course I’m doing.
When the onListItemClick
he sends a Toast
to screen, but I want you to open a new screen instead of showing a message when you click on the list. For the record, in this project I’m using Actionbarsherlock. This is the code I’ve made for now:
ListView ListViewSegunda;
String[] linhas = {"305", "306", "315"};
@Override
public void onActivityCreated(Bundle savedInstanceState){
super.onActivityCreated(savedInstanceState);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, linhas);
setListAdapter(adapter);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
// do something with the data
}
I appreciate the help from the community. Thank you.