Removing an activity from the history stack > Kotlin

본문 바로가기

사이트 내 전체검색

Kotlin

Removing an activity from the history stack

작성일 20-07-08 09:15

페이지 정보

작성자sbLAB 조회 3,728회 댓글 0건

본문

//로그인화면으로 PUSH
val intent = Intent(requireContext(), LoginActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK //기존 메인엑티비티 클리어
startActivity(intent)


Removing an activity from the history stack

Activity  위에 Activity  가 계속 쌓이는 상황(기존 실행중인 상태에서, 어플을 다시 처음부터 실행시켜 전역변수값을 적용하고 싶을때)에서
앞에 만들어진 Activity 를 제거 하는 옵션


https://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack 



<activity
    android:name=".AnyActivity"
    android:noHistory="true" />

댓글목록

등록된 댓글이 없습니다.

Copyright © 소유하신 도메인. All rights reserved.
PC 버전으로 보기