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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:21:06+00:00 2026-06-01T22:21:06+00:00

I create a notification applcation.Notification is comming.I want go to a new activity by

  • 0

I create a notification applcation.Notification is comming.I want go to a new activity by clicking on the notification. I have no idea how to do it.Please give me a help.Thank you !

I have 2 classes for notification
1. Notification_2Activity

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
       DatePicker dp = (DatePicker) findViewById(R.id.datePicker1);
        TimePicker tp = (TimePicker) findViewById(R.id.timePicker1);
     int month = dp.getMonth();
        int year = dp.getYear();
        int dayofmonth= dp.getDayOfMonth();

        int hourofday=tp.getCurrentHour();
        int minute=tp.getCurrentMinute();
        EditText e = (EditText) findViewById(R.id.editText1);
      e.setText("montho="+(month+1)+" year="+year+" day="+dayofmonth+" hour"+hourofday+" minute="+minute);
 Calendar cal = Calendar.getInstance();       //for using this you need to import java.util.Calendar;

        // add minutes to the calendar object
        cal.set(Calendar.MONTH,month);

        cal.set(Calendar.YEAR,year);                
        cal.set(Calendar.DAY_OF_MONTH, dayofmonth);
        cal.set(Calendar.HOUR_OF_DAY, hourofday);
        cal.set(Calendar.MINUTE, minute);


        Intent alarmintent = new Intent(getApplicationContext(), AlarmReceiver.class);
        alarmintent.putExtra("title","Title of our Notification");
        alarmintent.putExtra("note","Description of our  Notification");
        PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), HELLO_ID,
                alarmintent,PendingIntent.FLAG_UPDATE_CURRENT|  Intent.FILL_IN_DATA);


        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
        am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);

here is my second class
Alarmreceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub


    NotificationManager manger = (NotificationManager)     
            context.getSystemService(Context.NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.ic_launcher, "Combi Note",
             System.currentTimeMillis());
            PendingIntent contentIntent = PendingIntent.getActivity(context, 
            NOTIFICATION_ID, 
            new Intent(context, NotifyMessage.class), 0);

                    Bundle extras=intent.getExtras();
                    String title=extras.getString("title");
            //here we get the title and description of our Notification
                        //
                    String note=extras.getString("note");
                    notification.setLatestEventInfo(context, note, title, contentIntent);
                    notification.flags = Notification.FLAG_INSISTENT;
                    notification.defaults |= Notification.DEFAULT_SOUND;
            //here we set the default sound for our 
            //notification

                    // The PendingIntent to launch our activity if the user selects this notification
                    manger.notify(NOTIFICATION_ID++, 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-06-01T22:21:07+00:00Added an answer on June 1, 2026 at 10:21 pm
    Intent notificationIntent = new Intent(this, youractivity.class);
    PendingIntent contentIntent = PendingIntent
                                       .getActivity(this, 0, notificationIntent, 0);
    

    add ur activity name in manifest file

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

Sidebar

Related Questions

I want to create an application that will give a notification to the user
I want to create an application with apple push notification services. I have used
I want to create a notification that can be cleared. e.g. Swipe right on
I want to be able to create an alarm to ring a notification to
I want to create an iPhone application which will display notification that an incoming
Is it possible to create a Push Notification in Android? What I exactly want
i want to create reminder application...I am using Notification Manager... I am using this
Is it possible to create a notification bar that contains multiple icons horizontally and
Notification and NotificationManager are used to create icons to be placed on the top-left
How to create Entitlements.plist for push notification in XCODE 4.2? Can any one define

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.