300x250
* intent - Activity 전환
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) loginBtn.setOnClickListener { val nextIntent = Intent(this, LoginActivity::class.java) startActivity(nextIntent) } } }
* intent - Activity 종료
class LoginActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) backBtn.setOnClickListener { finish() } } }
반응형
'Android' 카테고리의 다른 글
Android) INSTALL_PARSE_FAILED_NO_CERTIFICATES 에러 (0) | 2020.11.19 |
---|---|
안드로이드 스튜디오 NOX 연동 (0) | 2020.03.30 |
Android) Login UI (with. Adobe XD) (0) | 2019.11.27 |
안드로이드) The activity must be exported or contain an intent-filter (2) | 2019.09.17 |
MQTT를 이용한 스마트홈(활용기술, 개발환경) (0) | 2018.06.19 |