I am working inside a Fragment that has a ListView. When the user clicks on a list row, I want to open another fragment that should show another ListView.
This is the method I have for now:
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String topic = String.valueOf(parent.getItemAtPosition(position));
Log.d("Comunidad",topic);
//PASA VALOR SELECCIONADO AL SIGUIENTE FRAGMENT
}
});
What is the best way to open the new Fragment from inside this method?
Thank you.