Android Question Application_Error and Screenshot

RauchG

Active Member
Licensed User
Longtime User
Currently I'm always in Resume a screenshot and deletes it when opening the next activity again.

Happened the error (the end) of the resume I have an empty screenshot.

I get by "Application_Error" an event for my activity back?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can find the foreground activity with:
B4X:
Dim bmp As Bitmap
For Each module As Object In Array (Main, Activity2, AnyOtherActivity)
 If IsPaused(module) = False Then
   bmp = CallSub(module, "TakeScreenshot") 'there should be a TakeScreenshot sub in each of the activities.
 End If
Next
If bmp.IsInitialized Then 
 ...
End If
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The screenshot must be taken from the activity.
Der Screenshot kann nur von einer Activity aus erstellt werden.
So you need to find the current foreground activity
Also musst Du ermitteln, welche Activity gerade im Vordergrund ist
and use CallSub to call a sub in that activity that will take the screenshot.
um dann mittels CallSub eine Sub (in genau dieser Activity) aufzurufen, die dann einen Screenshot erstellt.
 

Attachments

  • rauchg.zip
    8.3 KB · Views: 241
Upvote 0
Top