ошибка в LogCat: E/FragmentManager(7158): No view found for id 0x7f05000d (com.mybiz.mygame:id/fragment_container) for fragment MainMenuFragment{4052d780 #0 id=0x7f05000d}
Android Ошибка Fragment: Нет Просмотр Найденные ID
Ok вот как приложение устанавливается:
созданы два вары:
private static View oGoogleGamesView ;
private static RelativeLayout oViewGroup ;
Тогда в OnCreate:
oViewGroup = new RelativeLayout (this) ;
setContentView (oViewGroup) ;
LayoutInflater inflater = (LayoutInflater)this.getSystemService (Context.LAYOUT_INFLATER_SERVICE) ;
oGoogleGamesView = inflater.inflate (R.layout.ggmain, oViewGroup, false) ;
И тогда я пытаюсь показать фрагмент:
// create fragments
mMainMenuFragment = new MainMenuFragment();
// listen to fragment events
mMainMenuFragment.setListener(this);
// add initial fragment (welcome fragment)
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container,
mMainMenuFragment).commit();
И здесь он падает с ошибкой наверху. Вот файл XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</FrameLayout>
Что я могу сделать, чтобы показать фрагмент без сбоев?
Спасибо за e ответ, однако это приведет к поломке моего приложения, мне нужно, чтобы мой ContentView был установлен в oViewGroup. – Selzier
Вы хотите оставить сообщение для MainMenuFragment –