I\'m trying make an app that I\'m building take a search term from the main activity, return results, and then have the results be clickable such that a detail could be view
I had the same problem with fragment called twice and on the second time it crashed. Solution is to implement the remove statement in onDetach method:
@override
public void onDetach(){
super.onDetach();
FragmentManager fm = getFragmentManager()
Fragment xmlFragment = fm.findFragmentById(R.id.yourfragmentid);
if(xmlFragment != null){
fm.beginTransaction().remove(xmlFragment).commit();
}
}