David Marsh David Marsh - 3 months ago 8
Android Question

Use a drawable in rate app dialog

I have a dialog pop up to rate my app and on this dialog is the android icon.

What i want is to be able to chose a drawable instead of the system icon like have my app icon in its place! this is my first time in using a rate app dialog so apologies if this is a basic question to you all as to me its a tough one, i think you should only need this one section of code where the icon is but if you require the full class then i can post that.

builder.setMessage(message)
.setTitle("Rate " + APP_TITLE)
.setIcon(context.getApplicationInfo().icon)
.setCancelable(false)

Answer

You can just pass the resource Id of your app icon drawable, for example:

builder.setMessage(message)
            .setTitle("Rate " + APP_TITLE)
            .setIcon(R.drawable.app_logo)
            .setCancelable(false);

In this case app_logo can be drawable having your app icon.