Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9179419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:47:29+00:00 2026-06-17T17:47:29+00:00

My app has a login activity and it checks the credentials via an internet

  • 0

My app has a login activity and it checks the credentials via an internet website.
To do so, I (have to) use an AsyncTask class.
When login is successful, a global variable is set to true.

Because this is asynchronous, the activity won’t wait for the result so I would like to add an event that is fired by the post-execute method of the AsyncTask class.
Then a listener on the login activity will close itself and the main activity is visible.

I would like to know if and how this is possible.
I have tried some examples from other posts, but can’t figure it out from those.

I think I have to do the following:
– create an interface in the AsyncTask class
– from the post_execute method of that class, I raise the event, but how?
– put a listener in the login activity, but how?

any help is appreciated.

Regards,
Eric

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:47:30+00:00Added an answer on June 17, 2026 at 5:47 pm

    I would like to add an event that is fired by the post-execute method of the AsyncTask class. Then a listener on the login activity will close itself and the main activity is visible.

    onPostExecute() is already a callback, you could create another callback like you described but it is unnecessary. Simply pass a reference of your login Activity to your AsyncTask then use it to call finish() and startActivity() in onPostExecute().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When my app starts, it checks to see if it has stored login credentials.
I have made an iPhone App which has a loginwithFacebook button , the login
I have an app that uses facebook connect. When it has to login to
My app has a main login/password screen where user enters credentials and submits the
So I have an app that has a MySQL, PHP login..it was working great
My app has three main activity. Splash Activity Login Activity Menu Activity When I
I have Page Tab App, which has a landing page with a Log In
My app has started throwing errors when I try to save a particular class
My app has login, once the access is granted, it creates a new html
My app has a login screen before a user goes into the main view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.