Created
August 13, 2017 20:51
-
-
Save dharmakshetri/15b11461c37117de01c94145055ab8d7 to your computer and use it in GitHub Desktop.
secondActivity
This file contains hidden or 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 SecondActivity : AppCompatActivity() { | |
var sharedPref:SharedPreferences?=null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_second) | |
sharedPref=getSharedPreferences(MainActivity.MY_PREF, Context.MODE_PRIVATE) | |
textViewUserName.text="Username: "+ sharedPref!!.getString(MainActivity.NAME," ") | |
textViewPassword.text="Password: "+ sharedPref!!.getString(MainActivity.PASSWORD," ") | |
} | |
fun backBtn(view: View){ | |
var intentBack= Intent(applicationContext, MainActivity::class.java) | |
startActivity(intentBack) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment