You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make the following modifications to the vision quickstart demo app:
remove Java/Kotlin selection window (middle), defaulting to Java
open directly into Chooser Activity (right)
What I've done so far:
vision-quickstart > app > src > main > java > com > google > mlkit > vision > demo > EntryChoiceActivity
class EntryChoiceActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_vision_entry_choice)+ setContentView(R.layout.activity_chooser)- findViewById<TextView>(R.id.java_entry_point).setOnClickListener {
val intent = Intent(this@EntryChoiceActivity, ChooserActivity::class.java)
startActivity(intent)
- }- findViewById<TextView>(R.id.kotlin_entry_point).setOnClickListener {- val intent =- Intent(- this@EntryChoiceActivity,- com.google.mlkit.vision.demo.kotlin.ChooserActivity::class.java- )- startActivity(intent)- }
This achieves my intended objectives to open to the Chooser Activity for Java. The app loads and properly displays the Chooser Activity view, but if I press the back arrow (the left arrow on the 3 button navigation bar on the bottom) on the device emulator, the view reloads the Chooser Activity view failing to display the ListView. The two screenshots below show the before and after clicking the "back arrow".
How come the app fails to load the "ListView" under this condition?
Why does the app need to reload the same view after making these changes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to make the following modifications to the vision quickstart demo app:
What I've done so far:
vision-quickstart > app > src > main > java > com > google > mlkit > vision > demo > EntryChoiceActivity
This achieves my intended objectives to open to the Chooser Activity for Java. The app loads and properly displays the Chooser Activity view, but if I press the back arrow (the left arrow on the 3 button navigation bar on the bottom) on the device emulator, the view reloads the Chooser Activity view failing to display the ListView. The two screenshots below show the before and after clicking the "back arrow".
How come the app fails to load the "ListView" under this condition?
Why does the app need to reload the same view after making these changes?
Beta Was this translation helpful? Give feedback.
All reactions