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
Describe the bug
The MyAppLauncherActivity, which is started by the LauncherActivity, does not seem to return a result when it should. However, if I start an activity from a non-launcher activity, it works as expected. Additionally, when the intent for the CameraActivity is inside the main activity, the CameraActivity does not receive the ActivityResult from the camera.
To Reproduce
Steps to reproduce the behavior:
Launch the application.
The MyAppLauncherActivity is started as the launcherActivity.
In MyAppLauncherActivity, perform an action that should return a result (e.g., starting CameraActivity).
Complete the action in CameraActivity.
Expect MyAppLauncherActivity to receive the result, but it doesn't.
Expected behavior
MyAppLauncherActivity should receive the result from CameraActivity when it is started from the launcherActivity. Additionally, CameraActivity should receive the ActivityResult when its intent is inside the main activity.
Did this ever used to work
No, it has never worked as expected.
Screenshots
N/A
Code Snippets
MyAppLauncherActivity code:
packageme.myapp.core.androidimportandroid.content.Intentimportandroid.net.Uriimportandroid.os.Bundleimportandroid.os.Handlerimportandroid.os.Looperimportandroid.util.Logimportcom.google.androidbrowserhelper.trusted.LauncherActivityclassMyAppLauncherActivity : LauncherActivity() {
overridefunonCreate(savedInstanceState:Bundle?) {
super.onCreate(savedInstanceState)
intent?.data?.let { uri ->if (uri.scheme =="myapp"&& uri.host =="capture-invoice") {
val cameraIntent =Intent(this, CameraActivity::class.java).apply {
data = uri
}
startActivityForResult(cameraIntent, CAMERA_ACTIVITY_REQUEST_CODE)
}
}
}
overridefungetLaunchingUrl(): Uri {
val uri =this.intent.data
Log.d("MyAppLog", "Using URL from Intent ($uri).")
if (uri !=null) {
return uri
}
returnUri.parse("https://web.acc.myapp.dev")
}
overridefunonActivityResult(requestCode:Int, resultCode:Int, data:Intent?) {
super.onActivityResult(requestCode, resultCode, data)
Log.d("MyAppLog", "LauncherActivity - onActivityResult: $requestCode, $resultCode, $data")
if (requestCode ==CAMERA_ACTIVITY_REQUEST_CODE&& resultCode ==RESULT_OK) {
val redirectIntent =Intent(Intent.ACTION_VIEW, Uri.parse("https://web.acc.myapp.dev/received-invoices"))
startActivity(redirectIntent)
}
}
companionobject {
privateconstvalCAMERA_ACTIVITY_REQUEST_CODE=1003
}
}
The last piece of code run in the CameraActivy.kt (tested with logs and debugger)
setResult(RESULT_OK) // Set the result before finishing
Log.d("MyAppLog", "Image sent to server.")
finish()
Describe the bug
The MyAppLauncherActivity, which is started by the LauncherActivity, does not seem to return a result when it should. However, if I start an activity from a non-launcher activity, it works as expected. Additionally, when the intent for the CameraActivity is inside the main activity, the CameraActivity does not receive the ActivityResult from the camera.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
MyAppLauncherActivity should receive the result from CameraActivity when it is started from the launcherActivity. Additionally, CameraActivity should receive the ActivityResult when its intent is inside the main activity.
Did this ever used to work
No, it has never worked as expected.
Screenshots
N/A
Code Snippets
MyAppLauncherActivity code:
The last piece of code run in the CameraActivy.kt (tested with logs and debugger)
Manifest
Smartphone
Additional context
The text was updated successfully, but these errors were encountered: