Created
February 6, 2018 09:32
-
-
Save BALUSANGEM/4b6c2d37b6b64a81e3f3a69f075110f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_login) | |
goto_main_screen_button.setOnClickListener { | |
gotoMainScreen() | |
} | |
} | |
private fun gotoMainScreen() { | |
val intent = Intent(this, MainActivity::class.java) | |
startActivity(intent) | |
finish() | |
} | |
} | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
goto_password_screen_button.setOnClickListener { | |
gotoPasswordScreen() | |
} | |
} | |
private fun gotoPasswordScreen() { | |
val intent = Intent(this, PasswordActivity::class.java) | |
startActivity(intent) | |
} | |
} | |
class PasswordActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_password) | |
goto_login_screen_button.setOnClickListener { | |
gotoLoginScreen() | |
} | |
} | |
private fun gotoLoginScreen() { | |
val intent = Intent(this, LoginActivity::class.java) | |
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK | |
startActivity(intent) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment