第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

本地通知未在所有設(shè)備中觸發(fā)

本地通知未在所有設(shè)備中觸發(fā)

有只小跳蛙 2021-08-25 15:20:59
我有一個本地通知,每天在特定時間重復(fù)。我嘗試使用一些設(shè)備進行測試,但它僅適用于少數(shù)設(shè)備。請檢查下面的代碼并說明一些問題。我嘗試過三星和 LG 設(shè)備。下面是我的 AlarmReceiver public class AlarmReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    MediaPlayer mediaPlayer = MediaPlayer.create(context, Settings.System.DEFAULT_NOTIFICATION_URI);    mediaPlayer.start();    NotificationManager manager =            (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);    NotificationCompat.Builder builder = new NotificationCompat.Builder(context)            .setSmallIcon(R.drawable.logo)            //example for large icon            .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher))            .setContentTitle("Hey")            .setContentText("Did you read today")            .setOngoing(false)            .setPriority(NotificationCompat.PRIORITY_DEFAULT)            .setAutoCancel(true);    Intent i = new Intent(context, VerseActivity.class);    PendingIntent pendingIntent =            PendingIntent.getActivity(                    context,                    0,                    i,                    PendingIntent.FLAG_ONE_SHOT            );    // example for blinking LED    builder.setLights(0xFFb71c1c, 1000, 2000);    builder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI);    builder.setContentIntent(pendingIntent);    manager.notify(12345, builder.build());}}
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 147 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號