Android studio cannot find shortcut

I am trying to develop in Android studio on MAC and I am facing the weid problem. Inside the action code, I mean the image that is in the mipmap folder. In particular, I created a notification like:

... Notification notify = new NotificationCompat.Builder(this) .setContentTitle(title) .setContentText(body) .setSmallIcon(R.drawable.ic_launcher) .setContentIntent(startPendingIntent) .build(); ... 

and I get the error "cannot resolve ic_launcher character". The strange problem also is that I cannot copy the icon paste to the drawable folder, which is empty. Where and how should I place the icons so that they appear in the code in the android studio?

+6
source share
2 answers

You need to access the drawings using R.mipmap.ic_launcher

+13
source

Close Android Studio, then open the search engine. Go to the project directory. Go to the mipmap folder of your project. Copy the images, then go to the folder with the ability to copy and paste the images into the appropriate folders with permissions. Open android android studio and they should be in a drawable folder.

+1
source

Source: https://habr.com/ru/post/983740/


All Articles