片段交易 - 未找到ID 0x7f090022视图 [英] Fragment Transaction - No view found for id 0x7f090022
问题描述
我试图取代片段
当我点击一个项目名单的事情是,我已经得到了同样的code 5型动物片段
,它适用于所有的,只有在这个片段
说:
java.lang.IllegalArgumentException异常:未找到ID 0x7f090022视图(info.androidhive.slidingmenu:ID / frame_container)的片段DetallProductePerTipus {3899b306#1 ID = 0x7f090022}
块引用>报告说,
frame_container
找不到......这是怎么我做的替换:捆绑包=新包();
android.support.v4.app.Fragment片段=新DetallProductePerTipus();
bundle.putString(titol,item.title); fragment.setArguments(包); getFragmentManager()调用BeginTransaction() .replace(R.id.frame_container,片段).commit();我有问题,交易与
片段V4
,而不是V4
,然后我想也是这个:捆绑包=新包();
片段片段=新DetallProductePerTipus();
bundle.putString(titol,item.title); fragment.setArguments(包); getFragmentManager()调用BeginTransaction() .replace(R.id.frame_container,片段).commit();但它仍然无法正常工作...
我在做什么错了?
在同一个
片段
我这有code,使一个替换片段
中,我想的一样,但添加捆绑
。android.support.v4.app.FragmentManager FM = getActivity()getSupportFragmentManager()。
android.support.v4.app.FragmentTransaction英尺= fm.beginTransaction();
ft.replace(R.id.frame_container,新ListaProductosFragment());
ft.commit();
解决方案终于解决了我的问题,这样做的:
捆绑包=新包();
bundle.putString(titol,item.title);
android.support.v4.app.FragmentManager FM = getActivity()getSupportFragmentManager()。
片段片段=新DetallProducteOffer();
fragment.setArguments(包);
fm.beginTransaction()
.replace(R.id.frame_container,片段).commit();I'm trying to replace a
Fragment
when I click on a item List, the thing is that I've got the same code for 5 differentsfragments
and it works on all, only on thisFragment
says :java.lang.IllegalArgumentException: No view found for id 0x7f090022 (info.androidhive.slidingmenu:id/frame_container) for fragment DetallProductePerTipus{3899b306 #1 id=0x7f090022}
It says the
frame_container
is not found... This is how I do the replace :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 transaction with
Fragments v4
and notv4
, and then I tried also 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 doesn't work...
What I'm doing wrong?
On the same
Fragment
I've got this code that makes a replace of aFragment
, I want the same but adding theBundle
.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();
解决方案Finally solved my problem doing this :
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();
这篇关于片段交易 - 未找到ID 0x7f090022视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!