0

I want to create a simple login in my application. From the SignInActivity, where user types his credentials, I start IntentService, which sends data to the server and obtains information about whether credentials are right or not. Errors, wrong credentials etc. are handled by onDestroy() method in my IntentService (for example Toast is displayed). I want to start another activity from this service, and also destroy the old one SignInActivity. Unfortunately I haven“t found anything helpful, could somebody help me? Thanks for you response.

Tom11
  • 2,419
  • 8
  • 30
  • 56

2 Answers2

1

You should send a Broadcast from your Service to your Activity to indicate successful login and from the Activity start the new one.

Ovidiu Latcu
  • 71,607
  • 15
  • 76
  • 84
0

Let's call your login activity A and the second Activity you're calling from this B. So, you can close A from B like this.

Community
  • 1
  • 1
Karthik Balakrishnan
  • 4,353
  • 6
  • 37
  • 69