android - Android 从 RemoteViews 开始活动,但恢复活动
问题描述
我想从 RemoteViews 开始活动。我的应用程序只有一个活动和许多片段。当我从通知开始活动时,活动从启动片段开始。如果活动可用且未被破坏,我想恢复活动。这是我当前的代码:
Intent openAppIntent = new Intent(this, MainActivity.class);
PendingIntent openAppPI = PendingIntent.getActivity
(this,0,openAppIntent,0);
views.setOnClickPendingIntent(R.id.viewId,openAppPI);
解决方案
推荐阅读
- javascript - 如果时间等于 x,如何创建一个执行的函数?
- css - 为 vuetify 组件添加颜色
- azure-devops - Azure Devops - 将 YAML 脚本中的变量设置为日期时间
- angular - Angular 7 - 无法绑定到 @Input() 属性
- linux - 如何使用 sudo 和文件权限解决 subshell 问题
- talend - tLogCatcher 未捕获子作业错误
- python - 将 df1 与 df2 匹配并将其替换为索引值(非内连接)
- c# - 如何在故事板上显示以编程方式添加的元素?
- javascript - VueJs 有像 React 这样的受控和不受控组件的概念吗?
- android - 从外部存储设置背景 png 图像