๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค - notification Intent ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋˜ MainActivity๋กœ ๋‹ค์‹œ ์ด๋™ํ•˜๊ธฐ ํ•ด๊ฒฐ

by Janger 2022. 3. 22.
728x90
๋ฐ˜์‘ํ˜•
Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);
notificationIntent.setAction(Intent.ACTION_MAIN);
notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

 

์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋Š” MainActivity๋กœ ๋‹ค์‹œ ์ด๋™์„ ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ.

 

 

์ถœ์ฒ˜: 

https://like-tomato.tistory.com/156

 

[Notification] ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ ์ค‘๋ณต ์‹คํ–‰ ๋ฌธ์ œ ์™„๋ฒฝ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์•ˆ๋“œ๋กœ์ด๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ฐœ๋ฐœํ•˜๋‹ค ๋ณด๋ฉด ๋Œ€๋ถ€๋ถ„์˜ ๊ฐœ๋ฐœ์ž๋“ค์ด ํ•„์ˆ˜์ ์œผ๋กœ ๊ฒช๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค. 1. ์•ฑ ์‚ฌ์šฉ์ค‘ ์•Œ๋ฆผ์„ ๋ˆ„๋ฅด๋ฉด ์•ฑ์ด ์ค‘๋ณต์œผ๋กœ ์‹คํ–‰๋˜๋Š” ๋ฌธ์ œ. 2. ๋ทฐํŽ˜์ด์ ธ ๊ฐฑ์‹  ๋ฌธ์ œ. ์œ„ 2๊ฐœ์˜ ๋ฌธ์ œ

like-tomato.tistory.com

https://stackoverflow.com/questions/5502427/resume-application-and-stack-from-notification

 

Resume application and stack from notification

I want to resume my app from a status bar notification in the exact same manner as when the user taps its icon in the launcher. That is: I want the stack to be in the same state as it was before the

stackoverflow.com

 

728x90
๋ฐ˜์‘ํ˜•