I was following a tutorial of Android and When I was done everything, I got a problem in this code:
getDrawable(R.drawable.ic_launcher);
And I got the message
**"ic_launcher cannot be resolved or is not a field"**
What's more, my icon doesn't appear in tablet emulator, but starts automatic. What's going on?
replace "mipmap" with "drawable"
I had the same problem while following a tutorial and i found out that my AndroidManifest.xml file had the following code :-
android:icon="@mipmap/ic_launcher
so I changed R.drawable to R.mipmap it solved the problem . Wherever I found out drawable I replaced it with mipmap. Good to check for mipmap with android studio 1.1. for more info :-https://androidbycode.wordpress.com/2015/02/14/goodbye-launcher-drawables-hello-mipmaps/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With