Android Intent 전환 (액티비티 전환)
2019. 7. 15. 01:32
액티비티 A와 액티비티 B가 있다. 코드상으로 현재 액티비티 A의 어떤 Component의 onClick()함수를 통해 액티비티 B로 전환하려고 한다. 이럴 때엔 어떻게 코드를 써야할까? 1. 액티비티 전환 Intent intent = new Intent(Activity_A.this, Activity_B.class); startActivity(intent); 이렇게만 쓰면 onClick()에서 바로 액티비티를 B로 전환할 수 있다. 하지만, Activity A위에 있지만 다른 클래스에서 startActivity를 Call 할 수가 없는 상황에서는, 무슨 방법으로든 현재 context를 받아와서 다음과 같이 써주면 된다. mContext = ???//call Intent intent = new Intent..