znieh99
Fortgeschrittenes Mitglied
- 12
Hallo Forum,
ich verwende ein shape in drawable welches mir runde Kanten bei LinearLayouts ermöglichen soll. Das hat auch schon funktioniert (auch auf meiner HW ein LG-H525n). Nun funktioniert es zwar im Emulator aber nicht auf der HW. (Fehlermeldung: "Leider wurde das Programm Akkuschoner beendet"). Entferne ich die Zeile "android:background="@drawable/round_corner" aus dem LinearLayout funktioniert es auch auf der HW.
lg Heinz
drawable/round_corner.xml(v24):
Der run-log sagt:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.heinz.akkuschoner, PID: 23879
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.heinz.akkuschoner/com.app.heinz.akkuschoner.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class <unknown>
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.app.heinz.akkuschoner.MainActivity.onCreate(MainActivity.java:12)
ich verwende ein shape in drawable welches mir runde Kanten bei LinearLayouts ermöglichen soll. Das hat auch schon funktioniert (auch auf meiner HW ein LG-H525n). Nun funktioniert es zwar im Emulator aber nicht auf der HW. (Fehlermeldung: "Leider wurde das Programm Akkuschoner beendet"). Entferne ich die Zeile "android:background="@drawable/round_corner" aus dem LinearLayout funktioniert es auch auf der HW.
lg Heinz
drawable/round_corner.xml(v24):
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Definiert abgerundete Ecken und die Hintergrundfarbe für ein Layout -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#393939"/>
<stroke android:width="1dp"
android:color="#555555"/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
Der run-log sagt:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.heinz.akkuschoner, PID: 23879
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.heinz.akkuschoner/com.app.heinz.akkuschoner.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5527)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class <unknown>
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.app.heinz.akkuschoner.MainActivity.onCreate(MainActivity.java:12)