Intent intent = new Intent(Service.this, TargetActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
在消息处理的方法中执行这段代码
其中,Service是接收消息的实现类. TargetActivity是要跳转到的activity
具体为什么要这样写我也不知道,不过这样写确实实现了我要的效果....
Intent intent = new Intent(Service.this, TargetActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
在消息处理的方法中执行这段代码
其中,Service是接收消息的实现类. TargetActivity是要跳转到的activity
具体为什么要这样写我也不知道,不过这样写确实实现了我要的效果....
转载于:https://my.oschina.net/u/3219359/blog/908153