Deal with null and better naming

This commit is contained in:
ligi 2017-09-02 18:36:15 +02:00
parent 57631eb18e
commit ddbaff13dc
No known key found for this signature in database
GPG key ID: 8E81894010ABF23D

View file

@ -15,14 +15,20 @@ class TouchImageActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val webView = TouchImageView(this)
val touchImageView = TouchImageView(this)
setContentView(webView)
setContentView(touchImageView)
webView.setImageBitmap(passStore.currentPass!!.getBitmap(passStore, intent.getStringExtra("IMAGE")))
val bitmap = passStore.currentPass?.getBitmap(passStore, intent.getStringExtra("IMAGE"))
if (bitmap == null) {
finish()
} else {
touchImageView.setImageBitmap(bitmap)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
}
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
android.R.id.home -> {