カスタムInflationException
でConstraintLayout
を使用すると、Notification
が表示されます。 Notification
のカスタムレイアウトではなく、アプリの他の場所で使用できます。サポートライブラリに含まれているウィジェットはRemoteView
では使用できないと想定していますが、それに関する確認はありません。誰か知っていますか?
E/StatusBar: couldn't inflate view for notification com.example.app/0x1
Android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class Android.support.constraint.ConstraintLayout
Caused by: Android.view.InflateException: Binary XML file line #2: Error inflating class Android.support.constraint.ConstraintLayout
Caused by: Java.lang.ClassNotFoundException: Didn't find class "Android.support.constraint.ConstraintLayout" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/TeleService/lib/arm64, /system/fake-libs64, /system/priv-app/TeleService/TeleService.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.Java:93)
at Java.lang.ClassLoader.loadClass(ClassLoader.Java:379)
at Java.lang.ClassLoader.loadClass(ClassLoader.Java:312)
at Android.view.LayoutInflater.createView(LayoutInflater.Java:606)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:790)
at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:730)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:492)
at Android.view.LayoutInflater.inflate(LayoutInflater.Java:423)
at Android.widget.RemoteViews.inflateView(RemoteViews.Java:3278)
at Android.widget.RemoteViews.-wrap1(Unknown Source:0)
at Android.widget.RemoteViews$AsyncApplyTask.doInBackground(RemoteViews.Java:3380)
at Android.widget.RemoteViews$AsyncApplyTask.doInBackground(RemoteViews.Java:3376)
at Android.os.AsyncTask$2.call(AsyncTask.Java:333)
at Java.util.concurrent.FutureTask.run(FutureTask.Java:266)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1162)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:636)
at Java.lang.Thread.run(Thread.Java:764)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.app, PID: 9732
Android.app.RemoteServiceException: Bad notification posted from package com.example.app: Couldn't inflate contentViewsandroid.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class Android.support.constraint.ConstraintLayout
at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:1775)
at Android.os.Handler.dispatchMessage(Handler.Java:105)
at Android.os.Looper.loop(Looper.Java:164)
at Android.app.ActivityThread.main(ActivityThread.Java:6541)
at Java.lang.reflect.Method.invoke(Native Method)
at com.Android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.Java:240)
at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:767)
RemoteViewsオブジェクト(およびその結果、アプリウィジェット)は、次のレイアウトクラスをサポートできます。
FrameLayout
LinearLayout
RelativeLayout
GridLayout
そして、次のウィジェットクラス:
AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView
ViewFlipper
ListView
GridView
StackView
AdapterViewFlipper
これらのクラスの子孫はサポートされていません。
詳細: https://developer.Android.com/guide/topics/appwidgets/index.html#CreatingLayout