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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:08:44+00:00 2026-05-25T06:08:44+00:00

my code is public class AlarmReceiver extends BroadcastReceiver { public Notification mNotification = null;

  • 0

my code is

public class AlarmReceiver extends BroadcastReceiver {
public Notification mNotification = null;
public NotificationManager mNotificationManager = null;

@Override
public void onReceive(Context context, Intent intent) {
    Toast.makeText(context, "time up!", Toast.LENGTH_SHORT).show();
    mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    mNotification = new Notification(R.drawable.icon, "tip!",
            System.currentTimeMillis());
    mNotification.contentView = new RemoteViews(context.getPackageName(),
            R.layout.notification);
    mNotification.contentView.setTextViewText(R.id.tv_tip, "click to see the description");
    Intent notificationIntent = new Intent(context,NotificationTip.class);
    notificationIntent.putExtra("description", intent.getStringExtra("description")) ;
    //notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
            notificationIntent, 0);
    mNotification.contentIntent = contentIntent;
    mNotificationManager.notify(0, mNotification);
}

}

While when I click the item in notification ,I can’t get to NotificationTip activity,so what’s wrong with this code?

  • 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-25T06:08:44+00:00Added an answer on May 25, 2026 at 6:08 am

    following line

     Intent notificationIntent = new Intent(context,NotificationTip.class);
    

    needs to be

    Intent notificationIntent = new Intent("X");
    

    Where X is the intent action name. this you have to add as intent filter in your android manifest file.

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

Sidebar

Related Questions

Code: public class SMH extends Activity { public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main);
The following code public class GenericsTest2 { public static void main(String[] args) throws Exception
I have the following code: public class Test { public static void Main() {
Here is a sample code: public class TestIO{ public static void main(String[] str){ TestIO
Code:public class duplicate { public static void main(String[] args)throws IOException { System.out.println(Enter words separated
Code: public interface IFoo { void Bar(); } public class FooClass : IFoo {
Here is my code: public class Main { public static void main(String[] args) {
in the following code: public class ApplicationContext extends Application { private static ApplicationContext instance;
Here is my code: public class Main extends Applet implements Runnable, KeyListener, java.awt.event.MouseListener {
I have the following code: public class Tests { public static void main(String[] args)

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.