Android 안드로이드
서비스에서 알림창을 먼전 띄우고 매로리 해제된 activity를
코드버무려
2015. 2. 13. 13:11
서비스에서 알림창을 먼전 띄우고 매로리 해제된 activity를 띄움
Context context = getApplicationContext();
Intent intent = new Intent(context, MnActy.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
Bundle bundle = new Bundle();
bundle.putString("BeReady", "You are almost next one!");
Intent popupIntent = new Intent(getApplicationContext(), AlertDialogActivity.class);
popupIntent.putExtras(bundle);
PendingIntent pendingIntent= PendingIntent.getActivity(getApplicationContext(), 0, popupIntent, PendingIntent.FLAG_ONE_SHOT);
try {
pendingIntent.send();
} catch (CanceledException e) {
e.printStackTrace();
}