Android Question Why does this Intent give zero ResultCode ?

jkhazraji

Active Member
Licensed User
Longtime User
B4X:
    Dim REQUEST_CODE = 99
    Dim i As Intent
    i.Initialize("", "")
    i.SetComponent("com.scanlibrary/.ScanActivity")
    i.PutExtra("OPEN_INTENT_PREFERENCE", 4) 'OPEN_CAMERA  = 4 or OPEN_MEDIA = 5
    Dim ActivityForResult As StartActivityForResult
    ActivityForResult.Initialize("Ion")
    ActivityForResult.Start(i,REQUEST_CODE)
Although:
* Required library is there and declared in #AdditionalJar
*Necessary permissions were provided
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
ResultCode 0 = RESULT_CANCELED

Check the unfiltered logs. You might see something from the target app. Maybe a missing runtime permission.

Barcode scanning: https://www.b4x.com/android/forum/t...imple-to-use-barcode-scanning.160725/#content

Document scanning: https://www.b4x.com/android/forum/t...canner-based-on-google-ml-kit.160560/#content
unfiltered logs: onUnbind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
setScanResults mScanResults.size=1
here is the code main files:
 

Attachments

  • b4a_scanLibrary_demo.zip
    5.3 KB · Views: 75
Last edited:
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
Where does com.scanlibrary come from?
 
Upvote 0
Top