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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:00:38+00:00 2026-05-27T15:00:38+00:00

step1 > Intent i = new Intent(home.this, secondactivity.class); step2> Intent i = new Intent(android.intent.action.secondactivity);

  • 0

step1 > Intent i = new Intent(home.this, secondactivity.class);

step2> Intent i = new Intent(“android.intent.action.secondactivity”);

I am a little confused as to what difference does it make when creating an intent like in
step 1 or step 2

In the 1st one I am specifying the current instance of the class from which the activity should go to the next activity e.x on a button click in the home activity then it will go to the second activity.
In the 2nd one I am not doing that.

Does it makes any difference or both are same ?

  • 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-27T15:00:38+00:00Added an answer on May 27, 2026 at 3:00 pm

    They are different:

    In the first variant you explicitly say which component/activity to execute, so it’s guaranteed that you will execute that component. In that case your second activity doesn’t even need to have an intent-filter specified.

    In the second variant you specify an ACTION name. For that to work, your second activity must have an intent filter with the same action. However note that if by any chance there is another application with an activity which has an intent filter with the same action name, then when launching the activity, the user will get an activity picker dialog to choose which one to use.

    You should use the first variant if you ALWAYS want to execute your second activity on button click.

    You should use the second variant if you want to create an API, i.e. you want other applications to be able to hook into your application workflow.

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

Sidebar

Related Questions

I have a question this time around regarding the Android custom camera, NOT the
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all
I am trying to make an android game in eclipse (in windows). I keep
From my understanding, if an intent is invoked implicitly, android matches the intent object's
I have button and onClick I perform opening of a new activity like this:
I am very new to Android (and Java) originally a C# developer.. and am
I try this tutorial for building a Widget for Android Homescreen. http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf But if
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
http://steph.net23.net/work.php here is my test link. This page has a jquery script in it
So far and thanks to this website, I've been able to set up an

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.