I currently have my application set up with a ListFragment
on the left and a DetailsFragment
on the right (similar to the layout on the tablet belo
Fragments can only be replaced if they were initiallized in Java, not XML. I think so, I had the same problem and it solved it. Change your XML to this:
and then in Java, your onCreate method:
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.my_container, new DealDetailsFragment());
transaction.commit();
or even better create whole method to just deal with Transaction
s.
Now Transaction
from your question should work. :)