제가 타이머 작동중에 activity를 벗어나면 notification을 띄워 타이머 작동을 제어하고 notification 클릭시 다시 그 activity로 돌아오기 위해
Intent notification_intent = new Intent(context, ActivityLoding.class);
notification_intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notification_intent.setAction(Intent.ACTION_MAIN);
notification_intent.addCategory(Intent.CATEGORY_LAUNCHER);
notification_intent.putExtra("id", getIntent().getExtras().getInt("id"));
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notification_intent, 0);
builder = new Notification.Builder(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
builder.setSmallIcon(R.drawable.ready)
.setAutoCancel(true)
.setOngoing(true)
.setCustomContentView(remoteViews)
.setContentIntent(pendingIntent);
} else {
builder.setSmallIcon(R.drawable.ready)
.setAutoCancel(true)
.setOngoing(true)
.setContent(remoteViews)
.setContentIntent(pendingIntent);
}
다음과 같이 하고 안드로이드스튜디오에서 usb잭연결해서 폰에 받았을때는 잘 실행되었습니다.
그런데 apk를 만들어 구글플레이스토어에 올린뒤 받아서 실행하니 자기 activity화면으로 돌아가는게 아니라
그냥 새로 어플이 실행이 되었습니다. 코드가 문제라기에는 안드로이드스튜디오에서 바로 제폰에 받았을떄는 원하는대로 동작이 하여서 이상합니다.
바로받는것과 저코드 그대로 apk파일생성 후 플레이스토어에서 받아 하는것과 차이가 있나요?