草庐IT

pendingintent

全部标签

android - Android中的本地通知?

在iOS中,应用程序在后台使用“本地通知”来通知用户发生了一些事情,他们可能需要注意:Localnotifications...toinformuserswhennewdatabecomesavailableforyourapp,evenwhenyourappisnotrunningintheforeground.Forexample,amessagingappmightlettheuserknowwhenanewmessagehasarrived,andacalendarappmightinformtheuserofanupcomingappointment.Appledev-Loc

android - Android中的本地通知?

在iOS中,应用程序在后台使用“本地通知”来通知用户发生了一些事情,他们可能需要注意:Localnotifications...toinformuserswhennewdatabecomesavailableforyourapp,evenwhenyourappisnotrunningintheforeground.Forexample,amessagingappmightlettheuserknowwhenanewmessagehasarrived,andacalendarappmightinformtheuserofanupcomingappointment.Appledev-Loc

android - 待处理 Intent 的多个实例

我创建了一个小部件,单击该小部件会激活PendingIntent。问题是当屏幕上有多个小部件时,只有最新的小部件会启动PendingIntent。我已经阅读了一些关于唯一请求代码的信息,但没有弄清楚这一点。有什么想法可以让我拥有多个小部件并且PendingIntents可以为每个小部件工作吗?这是我的代码fragment:IntentopenApp=newIntent(context,RunningTally.class);openApp.putExtra("widgetId",appWidgetId);PendingIntentpendingAppIntent=PendingInte

android - 待处理 Intent 的多个实例

我创建了一个小部件,单击该小部件会激活PendingIntent。问题是当屏幕上有多个小部件时,只有最新的小部件会启动PendingIntent。我已经阅读了一些关于唯一请求代码的信息,但没有弄清楚这一点。有什么想法可以让我拥有多个小部件并且PendingIntents可以为每个小部件工作吗?这是我的代码fragment:IntentopenApp=newIntent(context,RunningTally.class);openApp.putExtra("widgetId",appWidgetId);PendingIntentpendingAppIntent=PendingInte

PendingIntent兼容安卓12 的一个问题

这是我第一次遇到这个问题,反正我也是第一次做完整的安卓app,很多个第一次。我之前做的那个老旧手机做桌面摆件的app,因为原来的“无干预”版本无法使用,所以又用回了“和风版”,但这个版本很久没用了,有些东西其实很旧就停了,所以重新搞搞,之前这个app在安卓11和鸿蒙上都可以了。但今天用安卓12的模拟器或鸿蒙启动后(可以启动),却无法进入主界面,直接FC。并出现下面出错信息:E/AndroidRuntime:FATALEXCEPTION:mainProcess:com.example.thirdversionclock,PID:14346java.lang.RuntimeException:Un

android - requestLocationUpdates with PendingIntent 和 Broadcast - 我得到什么广播

我设置了一个警报,该警报由启动WakefulIntentService(类LocationMonitor)的BroadcastReceiver接收。在LocationMonitor我有:privatestaticfinalintMIN_TIME_BETWEEN_SCANS=1*30*1000;privatestaticfinalintMIN_DISTANCE=0;@OverrideprotectedvoiddoWakefulWork(Intentintent){finalCharSequenceaction=intent.getAction();if(action==null){//m

android - Activity Recognition PendingIntent 停止在半夜被调用

我的应用程序会定期收集ActivityRecognition检测到的Activity数据。我实现了exactlyasdescribedinthedocumentation,但间隔一分钟。只要用户登录-应用程序注册了PendingIntent以接收来自googleplay进程的更新..请不要跟我讲每分钟请求更新导致的电池使用、网络和性能问题,除非它与我的问题有关:问题:在某些设备中(在Nexus5中最常发生),在半夜持续了5-6个小时-IntentService停止了叫。我不确定,但怀疑这与Google优化有关,并且重要的运动传感器未检测到任何进入Activity识别机制的运动处于某种空

android - PendingIntent.getBroadcast() 安全问题?

我正在查看documentation对于PendingIntent.getBroadcast(Context,int,Intent,int)它提到了......Forsecurityreasons,theIntentyousupplyhereshouldalmostalwaysbeanexplicitintent,thatisspecifyanexplicitcomponenttobedeliveredtothroughIntent.setClass安全原因到底是什么?如果其他应用程序仍然可以仅使用您的包名称和组件名称创建一个Intent,是什么让显式Intent更安全?我在NIST.

android - 使用 PendingIntent 开始新 Activity 时的混淆行为

我正在使用BroadCastListener来收听传入的电话统计信息,然后推送这样的通知:CharSequencecontentTitle="Contact:"+number;CharSequencecontentText="CallFrom:"+number;IntentnotificationIntent=newIntent(context,CallHandler.class);notificationIntent.putExtra(KEYS.NUMBER,number);notificationIntent.putExtra(KEYS.STATE,stat);notificati

Android requestLocationUpdates 使用 PendingIntent 和 BroadcastReceiver

如何使用requestLocationUpdates(longminTime,floatminDistance,Criteriacriteria,PendingIntentintent)在BroadcastReciver中,以便我可以不断获取GPS坐标。我是否必须为LocationListener创建一个单独的类?我的项目目标是当我收到BOOT_COMPLETED时开始定期获取GPSlats和longs。我试过的代码是:publicclassMobileViaNetReceiverextendsBroadcastReceiver{LocationManagerlocmgr=null;S