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 8647717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:08:16+00:00 2026-06-12T13:08:16+00:00

So I have a loading activity that needs to load every time a user

  • 0

So I have a loading activity that needs to load every time a user opens the program. I have the loading activity as the main activity in the manifest. If the loading activity is successful, it launches a HomeActivity. If I hit the back button from the HomeActivity, it will fire off the LoadingActivity when I try to access the app again. If I hit the home button from the HomeActivity, launching it goes back to the HomeActivity without going to the LoadingActivity.

I have tried adding those, clearTaskOnLaunch and FinishOnTaskLaunch. I have tried capturing the home button, that doesn’t work. I cannot finish onPause or onStop as I have the HomeActivity start an activity that opens up on top of the HomeActivity then drop back down to it. Any ideas on what to do? Heres the manifest, still learning android manifest stuff so don’t kill me.

<activity
        android:name=".start.LoadingActivity"
        android:screenOrientation="portrait" 
        android:clearTaskOnLaunch="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".HomeActivity"
        android:label="@string/title_activity_home"
        android:screenOrientation="nosensor" 
        >
    </activity>
  • 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-12T13:08:17+00:00Added an answer on June 12, 2026 at 1:08 pm

    Home button default function is to go to the home screen without killing the activity. Android users expect to the find the screen they were on when the come back to the app after pressing home button. So I recommned you change your design. But if you must do it your way, here’s one logic you can use.

    Every time you launch the main activity set a flag in shared preferences, say from_main=true. Then, in your onPause for main activity, check if from_main is true. If it’s true call finish(). If not, don’t do anything.

    Now, when you launch another activity from your main activity set the flag from_main in shared preferences to false.

    This way, you’ll now if onPause is being called before launching the other activity from main or after launching it. If it’s before launching it, then it won’t finish main and you can drop back down to it. If it’s after launching it, then it’ll finish the main activity.

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

Sidebar

Related Questions

I have the main activity which launches a loading screen activity. When the loading
I have an activity indicator that is working fine. Most of the time. But
I have a .NET web app that is taking a long time to load
I have defined an ArrayList in my main class where I am loading data
Goal: Have a ProgressDialog which shows Loading... until next Activity is completely loaded and
I have an activity that shows a ProgressDialog at start up which should disappear
I have a Fragment activity that has a ListFragment on the left and a
I have an activity that has two tabs and a list view in each.
I'm working on an App that needs to have a custom ringtone for certain
I have an activity which extends PreferenceActivity. I'm loading preferences from the xml file.

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.