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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:43:32+00:00 2026-05-31T15:43:32+00:00

I am working with android source. I am sending a broadcast from one of

  • 0

I am working with android source. I am sending a broadcast from one of the applications and have written the intent filter for the same in another application’s(Launcher) manifest as shown.

<receiver
       android:name="com.android.launcher2.LauncherModel"
       android:enabled="true"
       android:exported="true">
       <intent-filter>
           <action android:name="com.abc.THEMECHANGED" />
       </intent-filter>
   </receiver>

The class which extends receiver is com.android.launcher2.LauncherModel. I get the following exception in Launcher when the broadcast happens.

    01-01 00:01:45.101: WARN/dalvikvm(835): threadid=1: thread exiting with uncaught exception (group=0x40b131f8)
01-01 00:01:45.109: ERROR/AndroidRuntime(835): FATAL EXCEPTION: main
01-01 00:01:45.109: ERROR/AndroidRuntime(835): java.lang.RuntimeException: Unable to instantiate receiver com.android.launcher2.LauncherModel:               java.lang.InstantiationException: can't instantiate class com.android.launcher2.LauncherModel; no empty constructor
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2108)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.app.ActivityThread.access$1500(ActivityThread.java:125)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.os.Looper.loop(Looper.java:137)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.app.ActivityThread.main(ActivityThread.java:4368)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at java.lang.reflect.Method.invokeNative(Native Method)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at java.lang.reflect.Method.invoke(Method.java:511)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at dalvik.system.NativeStart.main(Native Method)
01-01 00:01:45.109: ERROR/AndroidRuntime(835): Caused by: java.lang.InstantiationException: can't instantiate class com.android.launcher2.LauncherModel; no empty  constructor
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at java.lang.Class.newInstanceImpl(Native Method)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at java.lang.Class.newInstance(Class.java:1319)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2103)
01-01 00:01:45.109: ERROR/AndroidRuntime(835):     ... 10 more

Can someone please let me know why this happens and the solution for the same

  • 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-31T15:43:33+00:00Added an answer on May 31, 2026 at 3:43 pm

    For the name you should only need the path to the class from the base package structure. In the manifest under the manifest tag there should be a package attribute, this will be your base package. Example:

    <manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.jjnford.example"
        android:versionCode="1"
        android:versionName="@string/version" >
    

    So if the receiver were in the package com.jjnford.example.lancher2 the manifest name should be:

    <receiver
        android:name=".launcher2.LauncherModel"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="com.abc.THEMECHANGED" />
        </intent-filter>
    </receiver>
    

    Also since your receiver is instantiated by the system you need to have an empty constructor as the system will call your onRecieve() method when your specified intent is caught.

    UPDATE

    Here is an example of how to created the BroadcastReceiver that is created programatically (look for my answer as it contains the code).

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

Sidebar

Related Questions

I am working on sending Meeting Invites from my Android app. Here is the
I am working on the contacts app from android open source project. My android
I'm working on an android application, and I have a drawable that I'm loading
I'm working on an android application, and I have a drawable that I'm loading
I am working in android. I designed a video player in my application. Most
I am working on android chat application. I am facing a problem in send
I just started working with Android and I have a problem with my map.
I am working in android chat application. I used SmartFox server. I am using
I am working on Android database type application. We need to show some reports.
I'm trying to get an html5 demo page working on Android 2.1, have tried

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.