Android Question Activity.Finish from starter (service)

sivakrith

Member
Licensed User
Longtime User
Hello,
Can we close an opened current activity from starter <service> ? Replication code is there in the starter (service) to update records from web database (postgres) to device database (sqlite). It works fine.
On certain value from web database, I want the activity to get closed automatically by displaying a message. Is it possible ?
We could not call a command like activity.finish in starter (service) file. Is there any other way that we could close the current active activity from starter (service) ?

Happiness Always
BKR Sivaprakash
 

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
In activity code create sub:
B4X:
sub finishActivity()
  activity.finish
end sub
In starter service call that sub:
B4X:
callsubdelayed(ActivityName,"finishactivity")
 
Upvote 0
Top