![](https://t1.daumcdn.net/keditor/emoticon/friends1/large/015.gif)
📱테스트 환경
Samsung Galaxy Android 13 • Android 10
😢 내가 겪은 문제
알림을 통해서 앱이 켜질때는 카카오톡처럼 애니메이션없이 화면이 바로 뜨게 하고싶었다. 그래서 ChatGPT 한테 물어봤더니
RecyclerView 에서 없애는 방법을 소개해줬는데 ...
init {
setHasStableIds(true)
}
// ... Other functions ...
override fun getItemViewType(position: Int): Int {
return 1 // Return a constant value for all items
}
override fun getItemId(position: Int): Long {
return position.toLong() // Return a unique ID for each item
}
역시나 안됐다 !! 기본적으로 액티비티가 쌓일 땐 아래 -> 위 종료될 땐 위 -> 아래 로 움직이는데, 없애는 방법은 의외로 간단했다 !!
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
overridePendingTransition(0, 0)
overridePendingTranstition(0, 0) 만 넣어주면 애니메이션이 작동을 안했다 !!
startActivity(intent) 다음에 넣어줘야한다는건데, 나 같은 경우에는 startActivity 위에 두니 작동을 안했었다 : (
아무튼 이렇게 쉽고 간편하게 애니메이션을 없애는 방법이 있으니 아주 만족스러운 해결방법이였다 : )
'Android > Kotlin' 카테고리의 다른 글
[Kotlin] Activity 간에 데이터 주고받는 방법 (0) | 2023.08.09 |
---|---|
[Kotlin] 앱 알림 보내기 (0) | 2023.08.09 |
[Kotlin] Splash Screen 만들기 (0) | 2023.08.09 |
[Kotlin] 앱 삭제 이후에도 일부 데이터 캐시 남아있을 때 (0) | 2023.08.09 |
[Kotlin] Retrofit2 연결 (0) | 2023.08.08 |