Describe the bug
Whenever I start another activity from my MyAppLauncherActivity it doesn't seem to start.
I can however get the other activity to start if I use a debugger, and do a "stepover" over the startActivity(). Another option is to delay the start of the activity. However this works very randomly (like 50% of the time). This is independent of the contents of the cameraActivity. Even if it just contains Logs it has the same issue.
Code
package com.my-app.android
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import com.google.androidbrowserhelper.trusted.LauncherActivity
class MyAppLauncherActivity : LauncherActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
intent?.data?.let { uri ->
if (uri.scheme == "my-app" && uri.host == "capture-invoice") {
val cameraIntent = Intent(this, CameraActivity::class.java).apply {
data = uri
}
Handler(Looper.getMainLooper()).postDelayed({
startActivity(cameraIntent)
}, 100)
}
}
}
override fun getLaunchingUrl(): Uri {
return Uri.parse("https://web.acc.my-app.dev")
}
}
Describe the bug Whenever I start another activity from my MyAppLauncherActivity it doesn't seem to start.
I can however get the other activity to start if I use a debugger, and do a "stepover" over the startActivity(). Another option is to delay the start of the activity. However this works very randomly (like 50% of the time). This is independent of the contents of the cameraActivity. Even if it just contains Logs it has the same issue.
Code
Expected behavior Expected is to start the other activity without needing a delay, and it starting every time.
Smartphone