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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:36:55+00:00 2026-05-24T10:36:55+00:00

In my manifest file, I have an activity declaration which looks something like this:

  • 0

In my manifest file, I have an activity declaration which looks something like this:

<activity android:name=".MainActivity">
          <intent-filter>
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
</activity>   

This activity is obviously launched on application start. User can navigate from this activity to another activity and from that one to another etc.
In another activity, I start MainActivity by using ‘startActivity’ method, ie. something like:

Intent intent = new Intent(AnotherActivity.this, MainActivity.class);
startActivity(intent);

In my MainActivity (in onCreate() method maybe), can I determine whether an activity was started from a action of from another activity? Is there something like “launcher listener”? I would like to avoid putting any extra content in the intent.
Can I simply put String s = getIntent().getAction(); in onCreate method and check whether it is has a value of MAIN?

  • 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-24T10:36:56+00:00Added an answer on May 24, 2026 at 10:36 am

    Well the stock android launcher does send Intent.ACTION_MAIN as as the action. However, you can’t be sure that some other launcher will have the same behaviour. Your best bet will be to pass some extra data with the Intent.

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

Sidebar

Related Questions

I have this intent in the manifest file: <activity android:name=.ProductStrategyActivity android:label=@string/product_strategy_header /> I get
If I use this code in my Manifest file: <activity android:name=.MyAct android:label=@string/app_name android:configChanges=orientation|keyboardHidden> //<-SEE
I have the following inside my manifest file: <service android:name=.Rotate android:enabled=true android:label=@string/app_name> <intent-filter> <action
In my app I have the main activity defined in the manifest.xml file like
I have created an Activity and declared in Manifest file. But I would like
I have 3 gits wrapped by a manifest file (this manifest file is in
can my activity broadcast this intent from itself Intent i = new Intent(android.provider.Telephony.SMS_RECEIVED); sendBroadcast(i);
In the manifest file of this application, I have specified the screen orientation to
In my manifest file, I have given the application name as MyApp and the
I have declared an activity and a broadcast receiver in my manifest file, however,

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.