로그 캣에서 오류를 찾지보기 : 여기 E/FragmentManager(7158): No view found for id 0x7f05000d (com.mybiz.mygame:id/fragment_container) for fragment MainMenuFragment{4052d780 #0 id=0x7f05000d}
안드로이드 조각 오류 : ID
확인이 응용 프로그램은 설정 방법 :
두 바르가 생성됩니다: 다음
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>
내가 사고없이 조각을 보여주기 위해 무엇을 할 수 있는가?
감사합니다. 전자 회신하지만,이 일을 내 애플 리케이션을 중단됩니다, 내 ContentView를 oViewGroup로 설정해야합니다. – Selzier
MainMenuFragment 코드를 게시 할 수 있습니까? –