StartService & msgbox

coinicon

New Member
Licensed User
Longtime User
Hi guys, I built a very simple app include a activity and a service, the service started by call StartService, the Activity used to interactive with user.

Now, user can exit the app by click the EXIT button on the activity, and app will show a msgbox let user confirm their action, like "do you realy want to exit?".

question is msgbox will not be modal and will return immediately, am I miss something?

thanks!
 

KZero

Active Member
Licensed User
Longtime User
Try this code in exit button it should work

Dim i As Int
i = Msgbox2("do you realy want to exit?", "confirm", "Yes", "", "No", null)

If i=DialogResponse.POSITIVE Then
Stopservice(servicename)
activity.finish
End If

note that you can't call msgbox from Service Module
 
Upvote 0

coinicon

New Member
Licensed User
Longtime User
still not works

thanks for the reply.

your suggestion is what I'm doing now, show up a msgbox and get user's choice. Problem is msgbox will return immediately with DialogResponse.CANCEL without waiting for user's response.

I notice that when service not start, msgbox will be modal and behave right.

thanks!
 
Upvote 0

KZero

Active Member
Licensed User
Longtime User
i tried it with started services also works normaly
if possible put your code maybe there is something wrong with it
 
Upvote 0
Top