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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:53:24+00:00 2026-06-14T05:53:24+00:00

I am having difficulty getting a BroadcastReceiver to process my IntentService response. The service

  • 0

I am having difficulty getting a BroadcastReceiver to process my IntentService response. The service processes multiple different actions and returns an action type. The receiver will never seem to pick it up, however. The intent does get called as I can debug and set a breakpoint in the IntentService and see the action get processed successfully. I just never see the textbox updated with the appropriate data or see the BroadcastReceiver evein being called.

IntentService

protected void onHandleIntent(Intent intent) {


        String action = intent.getAction();
        // Data the service was called with.
        Bundle incomingData = intent.getExtras();

        String key = incomingData.getString(KEY_APPKEY);
        String secret = incomingData.getString(KEY_SECRET);
        String collection = incomingData.getString(KEY_COLLECTION);

        CheckinManager cm = new CheckinManager(this.getApplicationContext(),key,secret,collection);

        Intent broadcastIntent = new Intent();

        broadcastIntent.addCategory(Intent.CATEGORY_DEFAULT);


        if (action == ACTION_GET_POI) {
            Double lat = incomingData.getDouble(KEY_LATITUDE);
            Double lon = incomingData.getDouble(KEY_LONGITUDE);

            ArrayList<POI> nearbyPOIs = new ArrayList<POI>();
            //broadcastIntent.setAction(ACTION_GET_POI_PROCESSED);
            broadcastIntent.setAction("com.msalinger.checkinmanager.CheckinService.getPOIProcessed");
            try {
                nearbyPOIs = cm.getPOI(lat, lon);

                broadcastIntent.putExtra(OUT_KEY_RESULT, true);
                broadcastIntent.putExtra(OUT_KEY_ERROR, "");
                broadcastIntent.putParcelableArrayListExtra(OUT_KEY_POILIST, nearbyPOIs);
            } catch (JSONException ex) {
                Log.d(TAG,ex.getMessage() + "\n" + ex.getStackTrace());
                broadcastIntent.putExtra(OUT_KEY_RESULT, false);
                broadcastIntent.putExtra(OUT_KEY_ERROR, ex.getMessage());
            }

        }
        else if (action == ACTION_CHECK_IN) {
            // Do something
        }
        else if (action ==  ACTION_GET_CHECKINS) {
            // Do Something
        }
        else if (action == ACTION_FIND_NEARBY_POIS_WITH_CHECKINS) {
            // Do Something 
        }    

        sendBroadcast(broadcastIntent);
}

Broadcast Receiver as sub-class of Main Activity

public class CheckinReceiver extends BroadcastReceiver {

        private final static String INTENT_BASE_URI = "com.msalinger.checkinmanager.CheckinService";

        private final static String ACTION_GET_POI_PROCESSED = ".getPOIProcessed";
        private final static String ACTION_CHECK_IN_PROCESSED = ".checkInProcessed";
        private final static String ACTION_GET_CHECKINS_PROCESSED = ".getCheckinsProcessed";
        private final static String ACTION_FIND_NEARBY_POIS_WITH_CHECKINS_PROCESSED = ".findNearbyPOIsWithCheckinsProcessed";


        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals("com.msalinger.checkinmanager.CheckinService.getPOIProcessed")) {
                tv = (TextView)findViewById(R.id.textBox1);

                Bundle incomingData = intent.getExtras();
                String st = "";

                if (incomingData.getBoolean("result")) {
                    ArrayList<POI> poiList = incomingData.getParcelableArrayList("poList");
                    st = printPOI(poiList);
                }
                else {
                    st = incomingData.getString("error");
                }
            }
            else if (intent.getAction().equals(INTENT_BASE_URI + ACTION_CHECK_IN_PROCESSED)) {

            }
            else if (intent.getAction().equals(INTENT_BASE_URI + ACTION_GET_CHECKINS_PROCESSED)) {

            }
            else if (intent.getAction().equals(INTENT_BASE_URI + ACTION_FIND_NEARBY_POIS_WITH_CHECKINS_PROCESSED)) {

            }
        }

    }

Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.msalinger.checkinmanagerdemo"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="15" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service 
            android:enabled="true" 
            android:name="com.msalinger.checkinmanager.CheckinService" />
        <receiver
            android:name=".CheckinReceiver">
            <intent-filter>
                <action android:name="com.msalinger.checkinmanager.CheckinService.getPOIProcessed" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.msalinger.checkinmanager.CheckinService.checkInProcessed" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.msalinger.checkinmanager.CheckinService.getCheckinsProcessed" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.msalinger.checkinmanager.CheckinService.findNearbyPOIsWithCheckinsProcessed" />
            </intent-filter>
        </receiver>        
    </application>
</manifest>

What am I doing wrong? Note that the IntentService exists as part of an Android class library with a different package than the Main activity.

  • 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-14T05:53:26+00:00Added an answer on June 14, 2026 at 5:53 am

    Because the receiver exists to update data in the activity, it should be registered when the activity resume and unregistered when the activity pause. And it should not be in the manifest (see the doc for this).

    If it’s not the case, it shouldn’t be a subclass of your activity.

    In all cases, I think your Receiver is not called because it has not the right name in the manifest. It may be something like this : .MainActivity$CheckinReceiver.

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

Sidebar

Related Questions

I am having difficulty getting multiple jPicker instances of the same type to display
I'm writing a plugin and having difficulty getting it to instantiate for multiple elements.
I am having difficulty getting rid if the following error: bash-3.00$ p4 login Enter
I'm having difficulty getting XQuery to work. I downloaded Saxon-HE 9.2. It seems to
I'm having difficulty getting GNUplot to properly render some of my data. Basically I
I am having difficulty getting several mod_rewrite rules to work together in my .htaccess
I am having difficulty getting rid of duplicate entries which are showing up in
I'm having great difficulty getting my Android application to play videos from the SD
I am having real difficulty getting my head around the issue of setting the
I'm a newbie to c# and am having some difficulty getting an integer from

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.