我正在尝试从Android docs说明的通知中启动活动,但是当我打开通知然后按后退按钮时,HomeActivity(父级)不会打开,而是应用程序关闭.我究竟做错了什么?
Intent resultIntent = new Intent(context, MatchActivity.class);;
resultIntent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
// Adds the back stack for the Intent (but not the Intent itself)
stackBuilder.addParentStack(MainActivity.class);
stackBuilder.addNextIntent(resultIntent);
Run Code Online (Sandbox Code Playgroud) 如何发送提醒等通知,即使应用程序已关闭.
例如,当我们在日历上注册事件时,日历会在事件开始前10分钟(即)发送通知.我怎么能在我的申请上做到这一点?