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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:44:06+00:00 2026-05-13T12:44:06+00:00

I got back to the widget development after upgrading to the latest SDK and

  • 0

I got back to the widget development after upgrading to the latest SDK and all of the sudden my widget is failing on startup with this message:

ERROR/AndroidRuntime(5296): java.lang.RuntimeException: 
Unable to start receiver topjob.widget.SearchWidget: 
java.lang.SecurityException: Permission Denial: 
attempt to change component state from pid=5296, uid=10057, package uid=10048

Here’s two lines of code where exception occurs:

@Override
public void onEnabled(Context context) {
    PackageManager pm = context.getPackageManager();
    pm.setComponentEnabledSetting(new ComponentName("topjob",
            ".widget.SearchWidgetBroadcastReceiver"), 
            PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
            PackageManager.DONT_KILL_APP);
    startAlarm(context, UPDATE_RATE_SEC);
}

so in the code above startAlarm() is never executed since pm.setComponentEnabledSetting() throws the SecurityException

Am I missing any security settings in my manifest? Currently I have:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

I’m developing for SDK v. 1.5 and it used to work fine

P.S. It happens on the phone and the emulator

  • 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-13T12:44:06+00:00Added an answer on May 13, 2026 at 12:44 pm

    OK – this is not really answer but rather a workaround. If someone wants to step in and provide answer or explanations on how this should be done I would gladly accept that.
    Anyway – I got it working by changing newState flag from COMPONENT_ENABLED_STATE_ENABLED to PackageManager.COMPONENT_ENABLED_STATE_DEFAULT. Since my broadcast receiver has enabled state in the manifest it works just fine

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

Sidebar

Related Questions

I've got the JSON coming back like this: { responseData: [{ responseData: { translatedText:
I was given this code a while back. I finally got around to testing
After avoiding Java for years, I got back to it and found it more
Wow, I just got back a huge project in C# from outsourced developers and
We've got a web system running SQL Server 2005 for the back end, and
I've got a submission page in php with an html form that points back
I implemented a Lucene search solution awhile back, and it got me interested in
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
Got a class that serializes into xml with XMLEncoder nicely with all the variables
I just got burned by a widget. I could see the cause of 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.