PomepuyN / discreet-app-rate

A lightweight non intrusive app rate reminder for Android
http://nicolaspomepuy.fr/non-intrusive-app-rate
Apache License 2.0
464 stars 51 forks source link

View.setBackground is available only for API level 16 and above #11

Closed bartek-mindojo closed 10 years ago

bartek-mindojo commented 10 years ago

I get the following exception report:

java.lang.NoSuchMethodError: android.view.View.setBackground
at fr.nicolaspomepuy.discreetapprate.AppRate.showAppRate(AppRate.java:568)
at fr.nicolaspomepuy.discreetapprate.AppRate.checkAndShow(AppRate.java:355)

To get rid of it I set the following two lines to use setBackgroundDrawable method (although I know it might not be the best fix):

close.setBackground(activity.getResources().getDrawable(R.drawable.selectable_button_light));
close.setBackground(activity.getResources().getDrawable(R.drawable.selectable_button_dark));
alexeyvasilyev commented 10 years ago

Just checked the logs. I also have the same problem with the users who have Android 2.3 - 4.0.4.

PomepuyN commented 10 years ago

I just fixed it.