在“系统/应用程序”上安装程序时出现错误。当我使用“数据/应用程序”时,它运行良好。这是错误:
android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.ImageButton
E/AndroidRuntime( 2076): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
E/AndroidRuntime( 2076): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
E/AndroidRuntime( 2076): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 2076): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
E/AndroidRuntime( 2076): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2076): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2076): at android.app.ActivityThread.main(ActivityThread.java:3647)
E/AndroidRuntime( 2076): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2076): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 2076): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 2076): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 2076): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2076): Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.ImageButton
E/AndroidRuntime( 2076): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
E/AndroidRuntime( 2076): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
E/AndroidRuntime( 2076): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
E/AndroidRuntime( 2076): at android.app.Activity.setContentView(Activity.java:1657)
E/AndroidRuntime( 2076): at com.pniei.filemanager.Main.onCreate(Main.java:125)
E/AndroidRuntime( 2076): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2076): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
E/AndroidRuntime( 2076): ... 11 more
E/AndroidRuntime( 2076): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 2076): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 2076): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
E/AndroidRuntime( 2076): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
E/AndroidRuntime( 2076): ... 24 more
E/AndroidRuntime( 2076): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f02000e a=-1 r=0x7f02000e}
E/AndroidRuntime( 2076): at android.content.res.Resources.loadDrawable(Resources.java:1681)
E/AndroidRuntime( 2076): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime( 2076): at android.widget.ImageView.<init>(ImageView.java:118)
E/AndroidRuntime( 2076): at android.widget.ImageButton.<init>(ImageButton.java:85)
E/AndroidRuntime( 2076): at android.widget.ImageButton.<init>(ImageButton.java:81)
E/AndroidRuntime( 2076): ... 27 more
这是我的代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/offWhite">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/offWhite"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6dp"
android:layout_marginRight="2dp"
android:layout_marginTop="6dp"
android:src="@drawable/back"
android:id="@+id/back_button" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6dp"
android:layout_marginRight="2dp"
android:layout_marginTop="6dp"
android:src="@drawable/device_access_sd_storage"
android:id="@+id/home_button"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6dp"
android:layout_marginRight="2dp"
android:layout_marginTop="6dp"
android:src="@drawable/collections_view_as_list"
android:id="@+id/multiselect_button"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center_vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="14dp"
android:id="@+id/storage_label"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="14dp"
android:text="путь"
android:id="@+id/path_label"/>
<TextView
android:id="@+id/detail_label"
android:textColor="@color/brightRed"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14px"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
我没有想法,它可以是什么。我使用 Android 2.3 和 IntelliJ IDEA 社区版 12.0.4。