如果应用程序未在android中运行,如何处理通知挂起意图
如果我将挂起的意图设置为TvGuideActivity,则它;s没有加载DetailView,因为没有数据。如何修复这两个用例?您可以使用alarmmanager在特定时间点触发广播接收器。在broadcastreceiver中,您可以编写通知代码如果应用程序未在android中运行,如何处理通知挂起意图,android,notifications,android-pendingintent,Android,Notifications,Android Pendingintent,如果我将挂起的意图设置为TvGuideActivity,则它;s没有加载DetailView,因为没有数据。如何修复这两个用例?您可以使用alarmmanager在特定时间点触发广播接收器。在broadcastreceiver中,您可以编写通知代码 My Application StartUp Activity-> load tvguide Activity-> show program details activity I've implemented simple app n
My Application
StartUp Activity-> load tvguide Activity-> show program details activity
I've implemented simple app notification for my tv app guide activity, the user can set up a reminder for any tv program to notify before 5 min to start time when taps the notification he should see the detail program view.
StartUpActivity-> get the tv guide from server for next 24hrs
TvguideActivity-> display the TV guide
programDetailsActivity-> display program details
If the application is running in background I don't want to show the start-Up Activity, as TV guide already have the data and I want to show the detailView
To handle the above scenario I created notification pendingIntent to TVGuide Activity
Intent receiverIntent = new Intent(context, TvGuideActivity.class); this is all working as i want.
but my question is how can I handle the scenario when the app is not running (like user set up the reminder and terminate/force kill the app),
您可以使用alarmmanager在特定时间点触发广播接收器。在broadcastreceiver中,您可以编写通知代码
My Application
StartUp Activity-> load tvguide Activity-> show program details activity
I've implemented simple app notification for my tv app guide activity, the user can set up a reminder for any tv program to notify before 5 min to start time when taps the notification he should see the detail program view.
StartUpActivity-> get the tv guide from server for next 24hrs
TvguideActivity-> display the TV guide
programDetailsActivity-> display program details
If the application is running in background I don't want to show the start-Up Activity, as TV guide already have the data and I want to show the detailView
To handle the above scenario I created notification pendingIntent to TVGuide Activity
Intent receiverIntent = new Intent(context, TvGuideActivity.class); this is all working as i want.
but my question is how can I handle the scenario when the app is not running (like user set up the reminder and terminate/force kill the app),
感谢您的回复,但我的问题不是关于实现alarm manager,我已经实现了该部分,我只想知道如果在创建PendingEvent时应用程序未运行,如何处理通知挂起意图。您可以将一些数据绑定到它。那么您建议我将哪些活动添加到挂起的意图中?您正在显示程序的详细信息。获取此程序详细信息数据的位置。创建通知时,我将程序id设置为pending intent,并在TVGuideActivity中检索此值,然后加载详细信息视图感谢您的回复,但我的问题不是关于实现报警管理器,我已经实现了该部分,我只是想知道,如果在创建PendingEvent时应用程序未运行,如何处理通知挂起意图。您可以将一些数据绑定到它。那么您建议我将哪些活动添加到挂起的意图中?您正在显示程序的详细信息。获取此程序详细信息数据的位置。创建通知时,我将程序id设置为pending intent,并在TVGuideActivity中检索此值,然后加载详细信息视图。您可以使用alarmmanager设置报警。它将在该时间点自动调用broadcastreceiver。您可以使用广播接收器推送通知。您可以使用alarmmanager设置警报。它将在该时间点自动调用broadcastreceiver。您可以使用broadcastreceiver推送通知。