Develop
2016.11.28 11:49
[android] 버전 별 앱 알림 설정으로 이동하는 방법
조회 수 6043 댓글 0
첨부 '1' |
|
---|
# 내가 썼던 방법
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.KITKAT) { Intent intent = new Intent(); intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); intent.addCategory(Intent.CATEGORY_DEFAULT); //intent.setData(Uri.parse("package:" + getPackageName())); intent.putExtra("app_package", getPackageName()); intent.putExtra("app_uid", getApplicationInfo().uid); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); }else{ String packageName = "com.ncsoft.nccomix"; String SCHEME = "package"; String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName"; String APP_PKG_NAME_22 = "pkg"; String APP_DETAILS_PACKAGE_NAME = "com.android.settings"; String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails"; Intent intent = new Intent(); final int apiLevel = Build.VERSION.SDK_INT; if (apiLevel >= 9) { // above 2.3 intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts(SCHEME, packageName, null); intent.setData(uri); } else { // below 2.3 final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22 : APP_PKG_NAME_21); intent.setAction(Intent.ACTION_VIEW); intent.setClassName(APP_DETAILS_PACKAGE_NAME, APP_DETAILS_CLASS_NAME); intent.putExtra(appPkgName, packageName); } startActivity(intent); }
# 참고할 방법 (해보지는 않음 ㅋㅋ)
packageName = "your.package.name.here" try { //Open the specific App Info page: Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + packageName)); startActivity(intent); } catch ( ActivityNotFoundException e ) { //e.printStackTrace(); //Open the generic Apps page: Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS); startActivity(intent); }
[참고] http://www.makeuseof.com/tag/stop-annoying-notifications-android/
[참고] http://stackoverflow.com/questions/4421527/how-can-i-start-android-application-info-screen-programmatically
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
253 | System/OS | [linux] split 명령어 | hooni | 2014.03.11 | 5210 |
252 | Develop | [swift] UIView에서 subview 찾기 | hooni | 2022.12.09 | 5191 |
251 | Develop |
[ios] 기본 네비게이션바의 타이틀, back버튼 위치와 속성 변경
![]() |
hooni | 2016.05.16 | 5180 |
250 | Develop | [ios] Pod 특정 버전 설치하고 사용하기 | hooni | 2022.05.28 | 5163 |
249 | Develop |
[ios] DatePicker iOS 6.x 이하 디자인.
![]() |
hooni | 2014.04.10 | 5123 |
248 | Database | [mysql] MySql 에서 정렬 후 그룹 하는 방법 | hooni | 2015.05.07 | 5110 |
247 | System/OS | [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 | hooni | 2014.03.12 | 5085 |
246 | Develop | [c] Mac OS 에 gmp(gmp.h) 라이브러리 설치 | hooni | 2016.10.03 | 5064 |
245 | Develop |
[ios] Xcode를 사용해서 Static Library 만들기 (시뮬레이터 + 디바이스)
![]() |
hooni | 2015.01.03 | 5059 |
244 | Develop | [ios] 아이폰 GPS 사용하기 | hooni | 2014.05.24 | 5039 |
243 | Develop | [ios] How to set up clang formatter | hooni | 2015.09.17 | 5034 |
242 | Develop | [android] 코드에서 문자열로 Resource 가져오기 | hooni | 2015.07.09 | 5014 |