We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
具体实现
a. 添加权限:
b. 应用在需要显示桌面角标的场景,通过广播将信息发送给vivoLauncher:
广播参数:
action:launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM
packageName:应用包名
className:主类名
notificationNum:未读消息数目
简单示例:
Intent intent = new Intent();
int missedCalls = 10;
intent.setAction("launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM");
intent.putExtra("packageName", "com.android.xxxx");
intent.putExtra("className", "com.android.xxxx.Mainxxxx");
intent.putExtra("notificationNum", missedCalls);
intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
sendBroadcast(intent);
注意:
在8.0上,还需要给Intent加上下面的flag
Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND
The text was updated successfully, but these errors were encountered:
launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM
as 这个打不出来 FLAG_RECEIVER_INCLUDE_BACKGROUND
Sorry, something went wrong.
launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM as 这个打不出来 FLAG_RECEIVER_INCLUDE_BACKGROUND
#368 试一下。
No branches or pull requests
具体实现
a. 添加权限:
b. 应用在需要显示桌面角标的场景,通过广播将信息发送给vivoLauncher:
广播参数:
action:launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM
packageName:应用包名
className:主类名
notificationNum:未读消息数目
简单示例:
Intent intent = new Intent();
int missedCalls = 10;
intent.setAction("launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM");
intent.putExtra("packageName", "com.android.xxxx");
intent.putExtra("className", "com.android.xxxx.Mainxxxx");
intent.putExtra("notificationNum", missedCalls);
intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
sendBroadcast(intent);
注意:
在8.0上,还需要给Intent加上下面的flag
Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND
The text was updated successfully, but these errors were encountered: