투케이2K

764. (Android/Java) [유틸 파일] goAppNotificationSettingIntent : 앱 알림 설정 창 인텐트 이동 수행 본문

Android

764. (Android/Java) [유틸 파일] goAppNotificationSettingIntent : 앱 알림 설정 창 인텐트 이동 수행

투케이2K 2024. 4. 8. 19:29
반응형

[개발 환경 설정]

개발 툴 : AndroidStudio

 

[소스 코드]

 

    // -----------------------------------------------------------------------------------------
    // TODO [SEARCH FAST] : [goAppNotificationSettingIntent] : 앱 알림 설정 창 인텐트 이동
    // -----------------------------------------------------------------------------------------
    public static void goAppNotificationSettingIntent(Context mContext){

        /**
         * // -----------------------------------------
         * [goAppNotificationSettingIntent 메소드 설명]
         * // -----------------------------------------
         * 1. 앱 알림 설정 창 인텐트 이동 메소드
         * // -----------------------------------------
         * 2. 호출 방법 : C_Intent.goAppNotificationSettingIntent(A_Intro.this);
         * // -----------------------------------------
         * */

        try {
            // ===============================================================
            S_Log._F_(mContext, "앱 알림 설정 창 인텐트 이동 실시", null);
            // ===============================================================

            // [애플리케이션 알림 설정창 이동]
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
                intent.putExtra(Settings.EXTRA_APP_PACKAGE, mContext.getPackageName());
                mContext.startActivity(intent);
            }
        }
        catch (Exception e){

            // [수행할 수 있는 컴포넌트 없음]
            S_Log._printStackTrace_(mContext, S_FinalMsg.LOG_BUG_STATE, null, e);
        }
    }

 

반응형
Comments