AndroidDeveloperLB / MaterialPreferenceLibrary

Allows to have an ActionBar on PreferenceActivity
Apache License 2.0
406 stars 69 forks source link

preference.getIcon() referencing a null object #14

Closed Tomblarom closed 9 years ago

Tomblarom commented 9 years ago

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 9 years ago

You need to use "getIconCompat" , because "getIcon" is used only on the normal Preference class. Maybe I should deprecate the original one.

AndroidDeveloperLB commented 9 years ago

@Tomblarom Does it work fine now for you?

Tomblarom commented 9 years ago

I didn't test it yet. I'll give a reply soon :)

AndroidDeveloperLB commented 9 years ago

But you closed the issue...

AndroidDeveloperLB commented 9 years ago

If you've checked this issue, please close it.