Snippet transaction - no views were found for id 0x7f090022

I'm trying to replace Fragment when I click on the list of elements, the fact is that I have the same code for 5 different fragments , and it works on everyone, only on this Fragment says:

java.lang.IllegalArgumentException: no views were found for id 0x7f090022 (info.androidhive.slidingmenu: id / frame_container) for fragment DetallProductePerTipus {3899b306 # 1 id = 0x7f090022}

It says that frame_container not found ... Here's how I do the replacement:

  Bundle bundle = new Bundle(); android.support.v4.app.Fragment fragment = new DetallProductePerTipus(); bundle.putString("titol", item.title); fragment.setArguments(bundle); getFragmentManager().beginTransaction() .replace(R.id.frame_container, fragment).commit(); 

I had problems with a transaction with Fragments v4 , not v4 , and then I also tried this:

  Bundle bundle = new Bundle(); Fragment fragment = new DetallProductePerTipus(); bundle.putString("titol", item.title); fragment.setArguments(bundle); getFragmentManager().beginTransaction() .replace(R.id.frame_container, fragment).commit(); 

but it still does not work ...

What am I doing wrong?

In the same Fragment , I have this code that replaces Fragment , I want the same thing, but add a Bundle .

 android.support.v4.app.FragmentManager fm = getActivity().getSupportFragmentManager(); android.support.v4.app.FragmentTransaction ft = fm.beginTransaction(); ft.replace(R.id.frame_container, new ListaProductosFragment()); ft.commit(); 
-3
java android android-fragments
May 11 '15 at 13:54
source share
1 answer

Finally, my problem solved:

 Bundle bundle = new Bundle(); bundle.putString("titol", item.title); android.support.v4.app.FragmentManager fm = getActivity().getSupportFragmentManager(); Fragment fragment = new DetallProducteOffer(); fragment.setArguments(bundle); fm.beginTransaction() .replace(R.id.frame_container, fragment).commit(); 
0
May 11 '15 at 15:14
source share



All Articles