Mercurial > cgi-bin > hgweb.cgi > SimpleResizer
comparison app/src/main/java/com/bartsent/simpleresizer/EditImage.kt @ 3:21d2df45d350
Fix race condition.
author | David Barts <n5jrn@me.com> |
---|---|
date | Tue, 09 Feb 2021 08:56:00 -0800 |
parents | 06825e49f7aa |
children | b6a217c850fb |
comparison
equal
deleted
inserted
replaced
2:06825e49f7aa | 3:21d2df45d350 |
---|---|
8 import android.net.Uri | 8 import android.net.Uri |
9 import android.os.Bundle | 9 import android.os.Bundle |
10 import android.os.Environment | 10 import android.os.Environment |
11 import android.provider.MediaStore | 11 import android.provider.MediaStore |
12 import android.provider.OpenableColumns | 12 import android.provider.OpenableColumns |
13 import android.util.Log | |
13 import android.view.MenuItem | 14 import android.view.MenuItem |
14 import android.view.View | 15 import android.view.View |
15 import android.widget.EditText | 16 import android.widget.EditText |
16 import androidx.appcompat.app.AlertDialog | 17 import androidx.appcompat.app.AlertDialog |
17 import androidx.appcompat.app.AppCompatActivity | 18 import androidx.appcompat.app.AppCompatActivity |
34 | 35 |
35 override fun onCreate(savedInstanceState: Bundle?) { | 36 override fun onCreate(savedInstanceState: Bundle?) { |
36 super.onCreate(savedInstanceState) | 37 super.onCreate(savedInstanceState) |
37 binding = ActivityEditImageBinding.inflate(layoutInflater) | 38 binding = ActivityEditImageBinding.inflate(layoutInflater) |
38 setContentView(binding.root) | 39 setContentView(binding.root) |
40 Log.d("EditImage", "onCreate called") | |
39 } | 41 } |
40 | 42 |
41 // Cribbed from: https://stackoverflow.com/questions/5568874/how-to-extract-the-file-name-from-uri-returned-from-intent-action-get-content | 43 // Cribbed from: https://stackoverflow.com/questions/5568874/how-to-extract-the-file-name-from-uri-returned-from-intent-action-get-content |
42 private fun getFileName(uri: Uri): String? { | 44 private fun getFileName(uri: Uri): String? { |
43 var result: String? = null | 45 var result: String? = null |
67 }.show() | 69 }.show() |
68 } | 70 } |
69 | 71 |
70 override fun onResume() { | 72 override fun onResume() { |
71 super.onResume() | 73 super.onResume() |
74 Log.d("EditImage", "onResume called") | |
72 | 75 |
73 // Read the URI, die if we can't. | 76 // Read the URI, die if we can't. |
74 val imageUri = intent?.data | 77 val imageUri = intent?.data |
75 if (imageUri == null) { | 78 if (imageUri == null) { |
76 showError(getString(R.string.error_no_uri)) | 79 showError(getString(R.string.error_no_uri)) |