我的应用程序中有一条通知,代码如下:
public class NewMessageNotification {
private static final String NOTIFICATION_TAG = "NewMessage";
public static void notify(final Context context,
final String exampleString,final String boday ,final int number) {
final Resources res = context.getResources();
// This image is used as the notification's large icon (thumbnail).
// TODO: Remove this if your notification has no relevant thumbnail.
final Bitmap picture = BitmapFactory.decodeResource(res, R.drawable.billsms);
final String ticker = exampleString;
final String title = res.getString(
R.string.new_message_notification_title_template, exampleString);
final String text = boday;
final NotificationCompat.Builder builder …
Run Code Online (Sandbox Code Playgroud)