小窗播放从service启动activity startActi
2019-08-01 本文已影响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();
}