任何時候我嘗試使用我的連接作爲測試設備的應用程序崩潰,我看到這個錯誤。我不太確定問題在哪裏。 E/AndroidRuntime:致命例外:main 進程:com.delta.bartalk,PID:13668 java.lang.RuntimeException:無法啓動活動ComponentInfo {com.delta.bartalk/com.delta.bartalk.BartalkActivity}:android .content.res.Resources $ NotFoundException:資源ID#0x7f020000 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app .ActivityThread.access $ 800(ActivityThread.java:151) 在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1303) 在android.os.Handler.dispatchMessage(Handler.java:102) 的機器人。 os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 引起:android.content.res .Resources $ NotFoundException:資源ID#0x7f020000 at android.content.res.Resources.getValue(Resources.java:1266) at android.content.res.Resources.getDrawable(Resources.java:785) at android.content .Context.getDrawable(Context.java:403) at com.android.internal.widget.ActionBarView.setIcon(ActionBa rView.java:684) at com.android.internal.widget.ActionBarOverlayLayout.setIcon(ActionBarOverlayLayout.java:738) at com.android.internal.policy.impl.PhoneWindow.setDefaultIcon(PhoneWindow.java:1646) at android.app.Activity.initWindowDecorActionBar(Activity.java:2131) at android.app.Activity.setContentView(Activity.java:2146) at com.delta.bartalk.BartalkActivity.onCreate(BartalkActivity.java:64) at android.app.Activity.performCreate(Activity.java:5990) 在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 在機器人。 app.ActivityThread.handleLaunchActivity(ACTIV ityThread.java:2387) at android.app.ActivityThread.access $ 800(ActivityThread.java:151) at android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android。java.lang.reflect.Method.invoke(Method.java:372) internal.os.ZygoteInit.main(ZygoteInit.java:698)應用程序不斷崩潰。有任何想法嗎?
/*這是activity_bartalk.xml的我不太清楚剛開始是這是在錯誤可能是*/
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".BartalkActivity">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<com.delta.bartalk.AutoResizeTextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:textColor="#bc7ff6"
android:textStyle="bold"
android:maxLines="2"
android:textSize="600sp"
android:gravity="center"
android:text="@string/bartalk" />
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout android:id="@+id/fullscreen_content_controls"
style="?metaButtonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/black_overlay"
android:orientation="horizontal"
tools:ignore="UselessParent">
<EditText android:id="@+id/input_text"
style="?metaButtonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"``
android:hint="@string/what_do_you_want_to_say" />
</LinearLayout>
</FrameLayout>
</FrameLayout>
你好。請至少說明在發生事故之前你在做什麼。 – FiN
顯示您的代碼!基於logcat,你不需要在你的BartalkActivity的oncreate方法中使用的資源(ID#0x7f020000)。這就是我們可以從這 –
'Resources $ NotFoundException'中讀取的所有內容......在[mcve]中顯示您的代碼和Gradle文件 –