草庐IT

pendingintent

全部标签

android - 如何创建不同的pendingintent 使filterEquals() 返回false?

我正在使用AlarmManager来设置重复Intent,但它造成了一些小麻烦,所以希望任何人都可以提供帮助。总结有2个待处理的Intent。一个每天跑1000,另一个每天跑2000。每个都包含来自数据库的行id用于识别目的。代码如下所示:Intenti=newIntent(mContext,ScheduleReceiver.class);i.putExtra(RuleDBAdapter.KEY_ROWID,(int)taskId);PendingIntentpi=PendingIntent.getBroadcast(...);mAlarmManager.set(AlarmManage

android - 如何创建不同的pendingintent 使filterEquals() 返回false?

我正在使用AlarmManager来设置重复Intent,但它造成了一些小麻烦,所以希望任何人都可以提供帮助。总结有2个待处理的Intent。一个每天跑1000,另一个每天跑2000。每个都包含来自数据库的行id用于识别目的。代码如下所示:Intenti=newIntent(mContext,ScheduleReceiver.class);i.putExtra(RuleDBAdapter.KEY_ROWID,(int)taskId);PendingIntentpi=PendingIntent.getBroadcast(...);mAlarmManager.set(AlarmManage

android - android如何比较挂起的 Intent

PendingIntent.FLAG_NO_CREATE的文档阅读:FlagindicatingthatifthedescribedPendingIntentdoesnotalreadyexist,thensimplyreturnnullinsteadofcreatingit.我的问题:使用什么标准来比较PendingIntents?我猜这个标志使用了PendingIntent.equals,但我不确定该函数使用的是什么标准。是在使用action、requestCode、category、extras(我猜不是)等吗?上下文:如果我的闹钟尚未设置,我想启动一个带有待处理Intent的闹

android - android如何比较挂起的 Intent

PendingIntent.FLAG_NO_CREATE的文档阅读:FlagindicatingthatifthedescribedPendingIntentdoesnotalreadyexist,thensimplyreturnnullinsteadofcreatingit.我的问题:使用什么标准来比较PendingIntents?我猜这个标志使用了PendingIntent.equals,但我不确定该函数使用的是什么标准。是在使用action、requestCode、category、extras(我猜不是)等吗?上下文:如果我的闹钟尚未设置,我想启动一个带有待处理Intent的闹

android - 待定 Intent 中的intent.putExtra()不起作用

我正在通过服务类的警报接收器传递待处理的Intent。但是,在pendingIntent触发后,broadcastreceiver类没有接收到intent.putExtra()信息。这是我触发pendingIntent的代码Intentaint=newIntent(getApplicationContext(),AlarmReceiver.class);PendingIntentpendingIntent=PendingIntent.getBroadcast(getApplicationContext(),id,aint,PendingIntent.FLAG_UPDATE_CURREN

android - 待定 Intent 中的intent.putExtra()不起作用

我正在通过服务类的警报接收器传递待处理的Intent。但是,在pendingIntent触发后,broadcastreceiver类没有接收到intent.putExtra()信息。这是我触发pendingIntent的代码Intentaint=newIntent(getApplicationContext(),AlarmReceiver.class);PendingIntentpendingIntent=PendingIntent.getBroadcast(getApplicationContext(),id,aint,PendingIntent.FLAG_UPDATE_CURREN

android - PendingIntent 未在 Android 4.3 中打开 Activity

在我的Service中,我使用以下代码在正常运行时打开通知:privatefinalstaticNOTIFICATION_ID=412434;privatevoidstartNotification(){NotificationCompat.Builderbuilder=newNotificationCompat.Builder(this);builder.setSmallIcon(R.drawable.notification);builder.setContentTitle("Running");finalIntentintent=newIntent(this,MainActivi

android - PendingIntent 未在 Android 4.3 中打开 Activity

在我的Service中,我使用以下代码在正常运行时打开通知:privatefinalstaticNOTIFICATION_ID=412434;privatevoidstartNotification(){NotificationCompat.Builderbuilder=newNotificationCompat.Builder(this);builder.setSmallIcon(R.drawable.notification);builder.setContentTitle("Running");finalIntentintent=newIntent(this,MainActivi

android - 如何在 Android 中设置多个闹钟?

到目前为止,多亏了这个网站,我已经能够设置一个警报,即使我打开手机,它也会被设置并激活。现在,我设置了一个闹钟来显示事件A的提醒,我需要应用程序设置另一个闹钟来显示事件B的另一个提醒。我一定是做错了什么,因为它只触发事件A的提醒。似乎一旦设置,任何其他警报都被理解为同一个警报。:-(以下是我在两个步骤中所做的详细信息:1)我在某个Activity中设置了一个闹钟,在特定时间和日期会调用接收器Intentintent=newIntent(Activity_Reminder.this,AlarmReceiver_SetOnService.class);intent.putExtra("it

android - 如何在 Android 中设置多个闹钟?

到目前为止,多亏了这个网站,我已经能够设置一个警报,即使我打开手机,它也会被设置并激活。现在,我设置了一个闹钟来显示事件A的提醒,我需要应用程序设置另一个闹钟来显示事件B的另一个提醒。我一定是做错了什么,因为它只触发事件A的提醒。似乎一旦设置,任何其他警报都被理解为同一个警报。:-(以下是我在两个步骤中所做的详细信息:1)我在某个Activity中设置了一个闹钟,在特定时间和日期会调用接收器Intentintent=newIntent(Activity_Reminder.this,AlarmReceiver_SetOnService.class);intent.putExtra("it