嗨,我是Android编程新手
我能够在我的模拟器上成功运行hello world程序,但我无法运行其他程序,我正在编写developer.android.com/training
我收到了无法理解的logcat错误,而且我从2天开始搜索解决方案
Logcat错误
05-06 03:54:23.490:D / dalvikvm(1078):没有迟到的CheckJNI (已经上映)05-06 03:54:26.440:D / gralloc_goldfish(1078):模拟器 未检测到GPU仿真。 05-06 03:54:31.760: I / Choreographer(1078):跳过41帧!申请可能是 在主线程上做了太多工作。 05-06 03:54:32.190: E / FragmentManager(1078):找不到id 0x7f05003c的视图 片段(com.vijay.mgit:id / container) PlaceholderFragment {b2e07990#0 id = 0x7f05003c} 05-06 03:54:32.190: E / FragmentManager(1078):活动状态:05-06 03:54:32.190: D / FragmentManager(1078):Local FragmentActivity b2dfdce8状态: 05-06 03:54:32.230:D / FragmentManager(1078):
mCreated = truemResumed = false mStopped = false mReallyStopped = false 05-06 03:54:32.230:D / FragmentManager(1078):mLoadersStarted = false 05-06 03:54:32.230:D / FragmentManager(1078):b2dfdf58中的活动碎片: 05-06 03:54:32.240:D / FragmentManager(1078):#0: PlaceholderFragment {b2e07990#0 id = 0x7f05003c} 05-06 03:54:32.240: D / FragmentManager(1078):mFragmentId =#7f05003c mContainerId =#7f05003c mTag = null 05-06 03:54:32.240: D / FragmentManager(1078):mState = 0 mIndex = 0 mWho = android:fragment:0 mBackStackNesting = 0 05-06 03:54:32.250: D / FragmentManager(1078):mAdded = true mRemoving = false mResumed = false mFromLayout = false mInLayout = false 05-06 03:54:32.250: D / FragmentManager(1078):mHidden = false mDetached = false mMenuVisible = true mHasMenu = false 05-06 03:54:32.250: D / FragmentManager(1078):mRetainInstance = false mRetaining = false mUserVisibleHint = true 05-06 03:54:32.250:D / FragmentManager(1078):
mFragmentManager = FragmentManager {b2dfdf58 in DisplayMessageActivity {b2dfdce8}} 05-06 03:54:32.250: d / FragmentManager(1078):
mActivity=com.vijay.mgit.DisplayMessageActivity@b2dfdce8 05-06 03:54:32.260:D / FragmentManager(1078):添加了片段:05-06 03:54:32.280:D / FragmentManager(1078):#0: PlaceholderFragment {b2e07990#0 id = 0x7f05003c} 05-06 03:54:32.310: D / FragmentManager(1078):FragmentManager misc状态:05-06 03:54:32.310:D / FragmentManager(1078):
mActivity=com.vijay.mgit.DisplayMessageActivity@b2dfdce8 05-06 03:54:32.310:D / FragmentManager(1078):
mContainer=android.support.v4.app.FragmentActivity$2@b2dfdfd0 05-06 03:54:32.320:D / FragmentManager(1078):mCurState = 2 mStateSaved = false mDestroyed = false 05-06 03:54:32.320: D / FragmentManager(1078):查看层次结构:05-06 03:54:32.320: d / FragmentManager(1078):
com.android.internal.policy.impl.PhoneWindow $ {DecorView b2dffce0 V.E ....... 0,0-0,0} 05-06 03:54:32.330:D / FragmentManager(1078):
com.android.internal.widget.ActionBarOverlayLayout {b2e003a0 V.ED .... ... 0,0-0,0#1020313 android:id / action_bar_overlay_layout} 05-06 03:54:32.330:D / FragmentManager(1078):
android.widget.FrameLayout {b2e01030 V.E ..... ... 0,0-0,0#1020002 android:id / content} 05-06 03:54:32.360:D / FragmentManager(1078):
android.widget.TextView {b2dff860 V.ED .... ... 0,0-0,0} 05-06 03:54:32.380:D / FragmentManager(1078):
com.android.internal.widget.ActionBarContainer {b2e014b0 V.ED .... 0,0-0,0#1020314 android:id / action_bar_container} 05-06 03:54:32.380: d / FragmentManager(1078):
com.android.internal.widget.ActionBarView {b2e01a38 V.E ..... ... 0,0-0,0#1020315 android:id / action_bar} 05-06 03:54:32.380: d / FragmentManager(1078):
android.widget.LinearLayout {b2e02028 VFE ... C. ... 0,0-0,0} 05-06 03:54:32.390:D / FragmentManager(1078):
com.android.internal.widget.ActionBarView $ HomeView {b2e03188 V.E ..... ... 0,0-0,0} 05-06 03:54:32.390:D / FragmentManager(1078):
android.widget.ImageView {b2e035a0 V.ED .... ... 0,0-0,0#102025a android:id / up} 05-06 03:54:32.390:D / FragmentManager(1078):
android.widget.ImageView {b2e03980 V.ED .... ... 0,0-0,0#102002c android:id / home} 05-06 03:54:32.390:D / FragmentManager(1078):
android.widget.LinearLayout {b2e04d78 G.E ..... ... 0,0-0,0} 05-06 03:54:32.400:D / FragmentManager(1078):
android.widget.TextView {b2e05110 V.ED .... ... 0,0-0,0#1020265 android:id / action_bar_title} 05-06 03:54:32.400: d / FragmentManager(1078):
android.widget.TextView {b2e05e18 G.ED .... ... 0,0-0,0#1020266 android:id / action_bar_subtitle} 05-06 03:54:32.400: d / FragmentManager(1078):
com.android.internal.widget.ActionBarContextView {b2e064b8 G.E ..... ... 0,0-0,0#1020316 android:id / action_context_bar} 05-06 03:54:32.400: d / FragmentManager(1078):
com.android.internal.widget.ActionBarContainer {b2e06a08 G.ED .... 0,0-0,0#1020317 android:id / split_action_bar} 05-06 03:54:32.460: D / AndroidRuntime(1078):关闭VM 05-06 03:54:32.460: W / dalvikvm(1078):threadid = 1:线程退出未捕获的异常 (group = 0xb2b01ba8)05-06 03:54:32.610:E / AndroidRuntime(1078):致命 例外:主05-06 03:54:32.610:E / AndroidRuntime(1078):流程: com.vijay.mgit,PID:1078 05-06 03:54:32.610:E / AndroidRuntime(1078): java.lang.RuntimeException:无法启动活动 ComponentInfo {com.vijay.mgit / com.vijay.mgit.DisplayMessageActivity}: java.lang.IllegalArgumentException:找不到id 0x7f05003c的视图 片段(com.vijay.mgit:id / container) PlaceholderFragment {b2e07990#0 id = 0x7f05003c} 05-06 03:54:32.610: E / AndroidRuntime(1078):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.ActivityThread.access $ 800(ActivityThread.java:135)05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1196) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.os.Handler.dispatchMessage(Handler.java:102)05-06 03:54:32.610:E / AndroidRuntime(1078):at android.os.Looper.loop(Looper.java:136)05-06 03:54:32.610: E / AndroidRuntime(1078):at android.app.ActivityThread.main(ActivityThread.java:5017)05-06 03:54:32.610:E / AndroidRuntime(1078):at java.lang.reflect.Method.invokeNative(Native Method)05-06 03:54:32.610:E / AndroidRuntime(1078):at java.lang.reflect.Method.invoke(Method.java:515)05-06 03:54:32.610: E / AndroidRuntime(1078):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:779) 05-06 03:54:32.610:E / AndroidRuntime(1078):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)05-06 03:54:32.610:E / AndroidRuntime(1078):at dalvik.system.NativeStart.main(Native Method)05-06 03:54:32.610: E / AndroidRuntime(1078):引起:java.lang.IllegalArgumentException: 找不到id 0x7f05003c(com.vijay.mgit:id / container)的视图 片段PlaceholderFragment {b2e07990#0 id = 0x7f05003c} 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:930) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) 05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.Activity.performStart(Activity.java:5241)05-06 03:54:32.610:E / AndroidRuntime(1078):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168) 05-06 03:54:32.610:E / AndroidRuntime(1078):... 11更多
答案 0 :(得分:0)
我认为你的问题就在这里
无法启动活动ComponentInfo {com.vijay.mgit / com.vijay.mgit.DisplayMessageActivity}:java.lang.IllegalArgumentException:找不到ID为0x7f05003c的视图
您正在尝试启动具有某个ID的视图的活动,并且在任何资源文件中都找不到此ID。
更具体, 片段PlaceholderFragment 在DisplayMessageActivity活动