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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:15:51+00:00 2026-05-25T19:15:51+00:00

I have problem with receiving an intent sended by widget as PendingIntent: intent =

  • 0

I have problem with receiving an intent sended by widget as PendingIntent:

intent = new Intent(MyService.MY_ACTION);
pendingIntent = PendingIntent.getService(this, 0, intent, 0);
views.setOnClickPendingIntent(R.id.button, pendingIntent);

I added a broadcast receiver to MyService:

private BroadcastReceiver mIntentReceiver = new BroadcastReceiver()
{
    @Override
    public void onReceive(Context context, Intent intent) 
    {
        Log.d(TAG, "Intent command received");
        String action = intent.getAction();

        if( MY_ACTION.equals(action))
        {
            doSomeAction();
        }
    }
};

and finally I registered this receiver i onCreate method of the service:

IntentFilter filter = new IntentFilter();
filter.addAction(MY_ACTION);
registerReceiver(mIntentReceiver, filter);

And now when th MyService is running and I click the button, I get :

09-21 14:21:18.723: WARN/ActivityManager(59): Unable to start service Intent { act=com.myapp.MyService.MY_ACTION flg=0x10000000 bnds=[31,280][71,317] }: not found

I also tried to add an intent-filter (with MY_ACTION action) to manifest file to MyService but it causes calling onStartCommand method of MyService. And that is not what I want. I need to call the onReceive method of mIntentReceiver.

  • 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-25T19:15:52+00:00Added an answer on May 25, 2026 at 7:15 pm

    What do you want to do?

    If you register a broadcast receiver in your Service onCreate method then:

    • You should raise a broadcast intent, not a service intent. Change this:

      pendingIntent = PendingIntent.getService(this, 0, intent, 0);

    To this:

    pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
    
    • You service should be running to listen for this broadcast event, this will not run your service, since you are registering the receiver when the service is created.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem.. I'm receiving data from a client..Using a socket connection. But
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
im new with objective-c. I have problem with memory leaking when developing iphone app.
I have this problem in a bigger Project...... so I set up a 'Testpoject'
I have this problem in a project I'm working on: I have a list
This is a problem i have with data that i receive from a library
I am receiving the following error and cannot find the problem: You have an
I am facing problem in receiving email. I have a registration form, when form
I have a problem with converting raw-bytes values into java types. I am receiving

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.