๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android] android.intent.action.MY_PACKAGE_REPLACED

developer.android.com/reference/android/content/Intent#ACTION_MY_PACKAGE_REPLACED

 

Intent  |  Android ๊ฐœ๋ฐœ์ž  |  Android Developers

 

developer.android.com

android.content.Intent

public static final String ACTION_MY_PACKAGE_REPLACED

 

๋ธŒ๋กœ๋“œ์บ์ŠคํŠธ ์•ก์…˜: ๊ธฐ์กด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์œ„์— ์ƒˆ ๋ฒ„์ „์˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์„ค์น˜๋˜์—ˆ์„ ๋•Œ, ๊ต์ฒด๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—๊ฒŒ ๋ณด๋‚ด์ง„๋‹ค. ์ถ”๊ฐ€๋˜๋Š” ๋ฐ์ดํ„ฐ๋Š” ์—†๋‹ค. ์ธํ…ํŠธ ํ•„ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•ด ์ˆ˜์‹ ํ•œ๋‹ค.

protected ์ธํ…ํŠธ๋กœ ์‹œ์Šคํ…œ์—์„œ๋งŒ ๋ฐœ์†ก๋œ๋‹ค.

 

์ƒ์ˆ˜ ๊ฐ’: android.intent.action.MY_PACKAGE_REPLACED

 

<receiver android:name=".MyAppUpdateReceiver"
    android:enabled="true"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
    </intent-filter>
</receiver>

 

  • enabled ์†์„ฑ : true > ์‹œ์Šคํ…œ์ด ์•Œ์•„์„œ MyAppUpdateReceiver๋ฅผ ์‹คํ–‰ํ•˜๋„๋ก ํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— true.
  • exported ์†์„ฑ : true > ์‹œ์Šคํ…œ์œผ๋กœ๋ถ€ํ„ฐ ์ธํ…ํŠธ๋ฅผ ๋ฐ›์•„์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— true.

-> manifest ํŒŒ์ผ <receiver> ์†์„ฑ ํ™•์ธ