-1
:onCreateView()的片段不叫和展示我創建和放置一個片段是這樣黑屏
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment fragment = Fragment.instantiate(getApplicationContext(), item.getFragmentClass().getName());
ft.replace(R.id.content_frame, fragment, selectedNavItem);
ft.commit();
直到我從Eclipse中遷移到Android Studio中一切正常。但是,遷移我的啓動畫面(這是與片段過於活動)後運行,但是當我切換到mainactivity與調用片段像上面 - 它有時工作,有時沒有 - 它調用片段onCreate()
但不的onCreateView()
和公正停止顯示黑屏。
也許有一些問題,包括庫?
這裏是我的build.gradle具有依賴性
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile ('com.google.android.gms:play-services:6.5.87')
compile ('com.android.support:support-v13:21.0.3')
compile ('com.android.support:cardview-v7:21.0.3')
compile ('com.melnykov:floatingactionbutton:1.1.0')
compile ('com.astuetz:pagerslidingtabstrip:1.0.1')
compile ('com.actionbarsherlock:actionbarsherlock:[email protected]')
compile ('com.facebook.android:facebook-android-sdk:3.23.0')
compile (project(':libs:SlidingMenuLibrary'))
compile (project(':libs:SwipeToDismissUndoList-master'))
}
一些幫助將是非常讚賞,因爲我真的絕望了。