2种方法
1.直接启动
Intent intent = new Intent();
intent.setClassName("com.jinwei", "com.jinwei.A");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(intent);
2. Pending启动
try {
getPendingIntent().send();
} catch (CanceledException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
private PendingIntent getPendingIntent() {
Intent callback = new Intent();
callback.setClass(this, A.class);
callback.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);
return PendingIntent.getActivity(this, 0, callback, PendingIntent.FLAG_CANCEL_CURRENT);
}