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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:42:09+00:00 2026-05-17T02:42:09+00:00

I am using Button in main Activity. When i clicked this button it will

  • 0

I am using Button in main Activity. When i clicked this button it will go for another Activity. My question is.. when i clicked the Button it should not display another Activity window..For example..in my case when i clicked the button it will start another activity and in that Activity i have added functionality of Receiving Notification..Here What i want is When i clicked the button i should receive notification and it should display another Activity window. how can i do this..?I can do this my adding functionality of receiving Notification in Onclick. But I wont want in that way. I require two Activities..Please can any one suggest me how to do this.?

[CLARIFYING TEXT].

With in my first Acticity i had a Button. when i click that button it will start new Activity..ie.

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

with in this second Activity i added the code for receiving notification..

Now my question is when i am clicking the button in first Activity a new window will be displayed as i am starting second activity..What i want is i wont want a new window to be displayed..But i have to receive notification..

  • 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-17T02:42:10+00:00Added an answer on May 17, 2026 at 2:42 am

    I don’t really understand what you’re asking, but I think one of these should solve it:

    1) When the button is clicked use intents to open the activity:
    in onClick():

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

    this requires you’ve added the second activity as an activity to the app manifest file.

    2) if you want the second activity to open only when it receives the notification, use a service, then when you get the notification, bring the service to the foreground, but this will happen (unless you stop it) in an app, not just your own.

    Intents
    Services
    Opening other activities

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

Sidebar

Related Questions

I am using this simple code public class Main extends Activity { private ProgressDialog
I've created a button using HTML/CSS and a Java script. The button should direct
I am trying to display a button using jQuery template. The code is as
I am trying to make this button using CSS3: But my button looks like
I've heard that pressing the back button will essentially cause the current Activity to
I am launching activities from the main activity in my app using the call
I have a button in my main activity (act1) and in a widget. That
In my application i am using a PHP web server. In the main activity,
In my main activity I have a button with the text Play. I want
On my Main activity: button = (Button) findViewById(R.id.mainAddWatchButton); button.setOnClickListener(new Button.OnClickListener() { public void onClick(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.