I'm working on my first project with ListFragment
looking on the internet for tutorials and even the online course I'm doing.
When the onListItemClick
is created, it sends Toast
to the screen, but I want it to open a new screen instead of displaying a message when it clicks the list item. For the record, in this project I'm using ActionBarSherlock . Here's the code I've written 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
}
Thank you for the help of the community. Thank you.