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

  • SEARCH
  • Home
  • 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 7171933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:30:45+00:00 2026-05-28T15:30:45+00:00

Im working with Android 2.1, RoboGuice 1.1 and Guice 2.0 (without aop). My app

  • 0

Im working with Android 2.1, RoboGuice 1.1 and Guice 2.0 (without aop).
My app has a background thread that gets started in the onCreate method of the Activity which connects to a server and might need the user to provide credentials for logging in.

At first I found the PopupWindow in the API but I read in this post that it shouldn’t be used for that.

So I tried to inject my Activity into my background thread and to open a Dialog in a Runnable passed to Activity.runOnUIThread(Runnable r) but unfortunately roboguice is creating a new instance of my activity when injecting it into my background thread.

I now assume the correct way of implementing a Login-Dialog would be to send an Intent to my activity and let it show the Dialog. Furthermore I assume that the Activity needs to send an Intent (containing the credentials) back to the background thread.
Is this correct or is there a more elegant way of doing that?

In this post I found how to register a receiver for the Intent. But on which Activity instance should I call registerReceiver within the background thread?

Best regards

  • 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-05-28T15:30:46+00:00Added an answer on May 28, 2026 at 3:30 pm

    I would suggest to create an inner class in the activity that uses RoboAsyncTask and basically has access to the activity. That works well for me. If you need to be able to login from different activities you make it a top level class and pass the fragment or activity instance into the async task constructor and do the ui updates in onSuccess.

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

Sidebar

Related Questions

I have a working Android tuner project app that I want to use as
I'm working on Android App that will user's input data (from text box) store
I'm working with Android gestures and the onFling method. There are two float variables
I just started working with Android and I have a problem with my map.
I'm working on Android UI Thread, and there is one time-consuming work, so I
I am working on android geolocation application in that I have added marker for
I am working in Android with SQLite. My db has 2 tables: Table 1:
I'm working on android app development in which how get profiling information like Data
I already have a working android app with several persisted objects/classes. But what if
am working an android native app , and searching for a way to develop

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.