J
jdajul
Ambitioniertes Mitglied
- 1
Hallo, ich möchte gerne den RoundKnobButtonCustom Rotary Knob Control for Android - PocketMagic in meine Android App einbinden. Wenn ich das im Java Code mache funktioniert das Einbinden ohne Probleme, wenn ich jedoch versuche über XML das Layout zu erstellen kommt folgende Meldung:
Was mache ich denn da falsch?
Ich gehe davon aus, dass der Fehler darin liegt, dass ich noch keine PNGs zugewiesen habe. Wenn ich das wiederum im JavaCode machen will so bekomme ich eine NullpointerException.
Code:
5180-5180/jritter.bluetoothtest E/AndroidRuntime FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{jritter.bluetoothtest/jritter.bluetoothtest.MainActivity}: android.view.InflateException: Binary XML file line #126: Error inflating class jritter.bluetoothtest.RoundKnobButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #126: Error inflating class jritter.bluetoothtest.RoundKnobButton
at android.view.LayoutInflater.createView(LayoutInflater.java:508)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:128)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:77)
at jritter.bluetoothtest.MainActivity.onCreate(MainActivity.java:72)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
************at android.app.ActivityThread.access$1500(ActivityThread.java:117)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
************at android.os.Handler.dispatchMessage(Handler.java:99)
************at android.os.Looper.loop(Looper.java:130)
************at android.app.ActivityThread.main(ActivityThread.java:3683)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:507)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
************at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoSuchMethodException: RoundKnobButton(Context,AttributeSet)
at java.lang.Class.getMatchingConstructor(Class.java:643)
at java.lang.Class.getConstructor(Class.java:472)
at android.view.LayoutInflater.createView(LayoutInflater.java:480)
************at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
************at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
************at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
************at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
************at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
************at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
************at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
************at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
************at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
************at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:128)
************at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:77)
************at jritter.bluetoothtest.MainActivity.onCreate(MainActivity.java:72)
************at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
************at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
************at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
************at android.app.ActivityThread.access$1500(ActivityThread.java:117)
************at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
************at android.os.Handler.dispatchMessage(Handler.java:99)
************at android.os.Looper.loop(Looper.java:130)
************at android.app.ActivityThread.main(ActivityThread.java:3683)
************at java.lang.reflect.Method.invokeNative(Native Method)
************at java.lang.reflect.Method.invoke(Method.java:507)
************at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
************at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
************at dalvik.system.NativeStart.main(Native Method)
Was mache ich denn da falsch?
Ich gehe davon aus, dass der Fehler darin liegt, dass ich noch keine PNGs zugewiesen habe. Wenn ich das wiederum im JavaCode machen will so bekomme ich eine NullpointerException.
Code:
RoundKnobButton rkb = (RoundKnobButton) findViewById (R.id.rkb);
rkb.initializeLayers(parameters);
Zuletzt bearbeitet: