Answer the question
In order to leave comments, you need to log in
When calling another fragment from a fragment, the program crashes, why?
Through Navigation draw I load the list into the fragment, I want to select an element from this list and display its full description in the fragment
listView = (ListView) view.findViewById(R.id.TeoryList);
ArrayAdapter adapter = new ArrayAdapter(view.getContext(), android.R.layout.simple_list_item_1, informations);
listView.setAdapter(adapter);
listView.setClickable(true);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
fdiscription = new FragmentDiscription();
FragmentTransaction ftrans = getFragmentManager().beginTransaction();
ftrans.replace(R.id.content_main, fdiscription);
ftrans.commit();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question