Yul*_*mok 4 android android-appcompat android-vectordrawable
我的应用程序在API <v21下,因此我使用Android支持库23.2来管理我的vectorDrawables.
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
Run Code Online (Sandbox Code Playgroud)
所有视图都可以正常执行推送通知的图标:
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setColor(getResources().getColor(R.color.colorAccent))
.setSmallIcon(R.drawable.ic_play_arrow_white_24dp) //ERROR
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.playing));
Run Code Online (Sandbox Code Playgroud)
我有错误:
E/AndroidRuntime: FATAL EXCEPTION: main
android.app.RemoteServiceException: Bad notification posted from package com.ashomok.lullabies: Couldn't create icon: StatusBarIcon(pkg=com.ashomok.lullabiesuser=0 id=0x7f020053 level=0 visible=true num=0 )
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
在这种情况下如何使用vectorDrawable?有可能吗?
| 归档时间: |
|
| 查看次数: |
1514 次 |
| 最近记录: |