Android .setSmallIcon(R.mipmap.ic_launcher)

Ale*_*man 1 android firebase-cloud-messaging

我目前正忙于这个图罗蒂尔:http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

我被困在这一行:

最终 int 图标 = R.mipmap.ic_launcher;

它无法解析符号“R”

我怎样才能导入这个符号?

Ami*_*yay 5

要导入 R 类,只需编写:

import your_package_name.R;
Run Code Online (Sandbox Code Playgroud)

通常,该类R会自动导入,但如果您的任何 xml 文件中有错误,则不会创建 R 文件。