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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:16:04+00:00 2026-05-22T12:16:04+00:00

I am getting a ClassCastException on running this simple application. I’m trying to use

  • 0

I am getting a ClassCastException on running this simple application.

I’m trying to use the AlarmManager for the first time.

public class AlarmReciever extends BroadcastReceiver {

     @Override
     public void onReceive(Context context, Intent intent) {
       try {
         Bundle bundle = intent.getExtras();
         String message = bundle.getString("alarm_message");
         Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
        } catch (Exception e) {
         Toast.makeText(context, "There was an error somewhere, but we still received an alarm", Toast.LENGTH_SHORT).show();
         e.printStackTrace();

        }
     }

    }

this is my manisfest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.tcs.mine"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
         <activity android:name=".AlarmReciever"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  <receiver  android:process=":remote" android:name=".AlarmReceiver"></receiver>
 </application>
</manifest> 

What am I doing wrong?

  • 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-22T12:16:05+00:00Added an answer on May 22, 2026 at 12:16 pm

    AlarmReceiver is not an Activity but declared as one. Check the documentation on BroadcastReceiver and how to declare them in the manifest file. Maybe you want to check this tutorial

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

Sidebar

Related Questions

I am getting this error: java.lang.ClassCastException: $Proxy0 cannot be cast to rmi.engine.Call at Main.main(Main.java:39)
Im trying to display this listview, but I keep getting a: 07-17 21:14:22.233: ERROR/AndroidRuntime(349):
Please tell me why i am getting ClassCastException in this case I have type
I am getting this error Thread [TimerDemo(185)id=307040256] (Suspended (exception ClassCastException)) UiApplication.getUiApplication() line: 462 TimerDemoTask$1.run()
I am trying to use the code depicted in this thread How to check
I am getting the following errors when trying to run my application: Can you
I use red5 and setting/getting attributes using the IConnection class, but that's really not
I use red5 and setting/getting attributes using the IConnection class, but that's really not
Hi i am getting class cast exceptrion in this line wheel = (WheelView) findViewById(R.id.wheel);
Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the

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.