> The service doesn't stop when?

After clicking the stop button in MainActivity

//this the main Activity to startService and stopService by onClick
button
public void onClick(View v){
        Intent j = new Intent(this,BackGroundService.class);
        switch(v.getId()){
        case R.id.enter_btn:
                startService(j);
                break;
        case R.id.exit_btn:
                stopService(j);
                finish();
                break;
        };


In theory,if I click the  button exit_btn,

the BackGroundService will stop immediated?

But my process is always sending location number to my server which I
have been built.

MyLocation.class is update user's location every 60 second and send to
my server.

So the work will doing until the user click exit_btn to logout.

And I hope user can do other things when he login(click enter_btn).

So I use Service that cause "the send location number" will send in
background

so that he can doing his thing.


Why the exit_btn is clinking but service isn't closed

Is it the work not already done so the service won't stop?

But it's job just update location every 60s and send to server




Thank's for reading










-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to