Deal with null and better naming
This commit is contained in:
parent
57631eb18e
commit
ddbaff13dc
1 changed files with 10 additions and 4 deletions
|
@ -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 -> {
|
||||
|
|
Loading…
Reference in a new issue