美文网首页
小窗播放从service启动activity startActi

小窗播放从service启动activity startActi

作者: 安宇辛 | 来源:发表于2019-08-01 16:15 被阅读0次

本人亲测  很好用

Intent intent =new Intent(FloatingVideoService.this, MainActivity.class);

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

PendingIntent pendingIntent =

PendingIntent.getActivity(FloatingVideoService.this, 0, intent, 0);

try {

pendingIntent.send();

}catch (PendingIntent.CanceledException e) {

e.printStackTrace();

}

相关文章

网友评论

      本文标题:小窗播放从service启动activity startActi

      本文链接:https://www.haomeiwen.com/subject/mvcqdctx.html