package h.com.newserialapp.activity

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import h.com.newserialapp.R
import h.com.newserialapp.util.PrefHelper
import kotlinx.android.synthetic.main.activity_test.*

/**
 * Created by hxd on 2018/12/10.
 */
class TestActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test)
        viewEvent()
    }

    fun viewEvent() {
        bt_save.setOnClickListener { PrefHelper.getDefault().saveString("password", et01.text.toString()) }
        bt_obtain.setOnClickListener {
            et02.setText(PrefHelper.getDefault().getString("password", "no password"))
        }
    }
}