首页 > 解决方案 > Android 从 RemoteViews 开始活动,但恢复活动

问题描述

我想从 RemoteViews 开始活动。我的应用程序只有一个活动和许多片段。当我从通知开始活动时,活动从启动片段开始。如果活动可用且未被破坏,我想恢复活动。这是我当前的代码:

Intent openAppIntent = new Intent(this, MainActivity.class);
PendingIntent openAppPI = PendingIntent.getActivity
            (this,0,openAppIntent,0);
views.setOnClickPendingIntent(R.id.viewId,openAppPI);

标签: androidandroid-pendingintentremoteview

解决方案


推荐阅读