preference.getIcon() referencing a null object
Closed this issue · 5 comments
Tomblarom commented
I tried to tint the peference icon:
<com.lb.material_preferences_library.custom_preferences.Preference
android:summary="@string/scanmode_sum"
android:key="scanmode"
app:icon="@drawable/ic_scan"/>
and getting:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setTint(int)' on a null object reference
AndroidDeveloperLB commented
You need to use "getIconCompat" , because "getIcon" is used only on the normal Preference class.
Maybe I should deprecate the original one.
AndroidDeveloperLB commented
@Tomblarom Does it work fine now for you?
Tomblarom commented
I didn't test it yet. I'll give a reply soon :)
AndroidDeveloperLB commented
But you closed the issue...
AndroidDeveloperLB commented
If you've checked this issue, please close it.