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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:35:02+00:00 2026-06-17T19:35:02+00:00

I have a class for creating notifications. The class is like this: public class

  • 0

I have a class for creating notifications. The class is like this:

public class TimeAlarm extends BroadcastReceiver {

     NotificationManager nm;

     @Override
     public void onReceive(Context context, Intent intent) {
      nm = (NotificationManager) context
        .getSystemService(Context.NOTIFICATION_SERVICE);
      CharSequence from = "Scheduled Training";
      CharSequence message = "Please attend the scheduled training";
      //Intent notifyIntent = new Intent();



      PendingIntent contentIntent = PendingIntent.getActivity(context, 0, new Intent(), 0);

      Notification notif = new Notification(R.drawable.ic_launcher,
        "NeuroQ Scheduled Training", System.currentTimeMillis());
      notif.setLatestEventInfo(context, from, message, contentIntent);
      nm.notify(1, notif);


     }
    }

I have an activity called: QuizScreen, which is required to be opened when the notification is clicked. I have tried using:

Intent quiz_intent = new Intent(TimeAlarm.this, QuizScreen.class);
                        TimeAlarm.this.startActivity(quiz_intent);

But I am getting this error:

The constructor Intent(TimeAlarm, Class<QuizScreen>) is undefined

Where am I going wrong? How should I solve this issue?

  • 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-17T19:35:03+00:00Added an answer on June 17, 2026 at 7:35 pm

    use Intent quiz_intent = new Intent(context, QuizScreen.class); instead of Intent quiz_intent = new Intent(TimeAlarm.this, QuizScreen.class); For example,

    public class MyBroadcastReceiver extends BroadcastReceiver {
      private NotificationManager mNotificationManager;
      private int SIMPLE_NOTFICATION_ID;
    
      @Override
      public void onReceive(Context context, Intent intent) {
        mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notifyDetails = new Notification(R.drawable.android,"Time Reset!",System.currentTimeMillis());
        PendingIntent myIntent = PendingIntent.getActivity(context, 0, new Intent(context, Second.class), 0);
        notifyDetails.setLatestEventInfo(context, "Time changed", "Click on me to view my second activity", myIntent);
        notifyDetails.flags |= Notification.FLAG_AUTO_CANCEL;
    
        mNotificationManager.notify(SIMPLE_NOTFICATION_ID, notifyDetails);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple class that provides state codes like this: public class StateProvider
I started creating file downloader class. Here is what i have: public class Downloader
I'm creating a class that will have one public method, which returns a value
I have a class like following: public class Trainee { private static int numberOfTrainee
I have this class for creating a thread in Java package org.vdzundza.forms; import java.awt.Graphics;
Creating a class that implements DynamicObject public class Test : DynamicObject { public override
Consider I have a Task class like this : class Task { String title
I am creating unit tests with DUnit. I have a class that takes quite
I'm creating an air traffic control system. I have a class called plane that
i am creating a process using System.DIagnostics.Process in c# i have created a class

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.