Android Question Intent camera problem

Yunus ÖZ

Member
Licensed User
Hi,
This is my code which is running when i click to button
B4X:
Dim obj4Url As Object
   If ph.SdkVersion < 24 Then
       Dim uri As Uri
       uri.Parse("file://" & File.Combine(imageFolder, "iv1.jpg"))
       obj4Url = uri
   Else
       Dim FileProvider As JavaObject
       Dim context As JavaObject
       context.InitializeContext
       FileProvider.InitializeStatic("android.support.v4.content.FileProvider")
       Dim fileObj As JavaObject
       fileObj.InitializeNewInstance("java.io.File", Array(imageFolder, "iv1.jpg"))
       obj4Url= FileProvider.RunMethod("getUriForFile", Array(context, Application.PackageName & ".provider", fileObj))
   End If

Dim i4Cam As Intent
    i4Cam.Initialize("android.media.action.IMAGE_CAPTURE","")
    i4Cam.PutExtra("output", obj4Url)
    returnFrom="Camera"
    StartActivity(i4Cam)

when i close the activity and back, camera is running but when i click to "OK BUTTON" i have this error "Stopped: Camera" but if i remove the this line
B4X:
i4Cam.PutExtra("output", obj4Url)
it always running without problem
I think the file is being used in some way ???
 

Similar Threads

Top