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

  • Home
  • SEARCH
  • 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 8439763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:05:28+00:00 2026-06-10T08:05:28+00:00

I have an IntentService that is making a network call and receiving back some

  • 0

I have an IntentService that is making a network call and receiving back some JSON data. I package this response data in custom object that implements parcelable. If I add this parcelable object to an intent as an extra and then launch an activity using that intent, everything seems to work as expected, i.e. I can retrieve the parcelable from the intent in the newly created activity. However, if I create the intent from within the onHandleIntent() method of my IntentService and then use sendBroadcast(), the broadcast receiver’s onReceive() method never fires. If I don’t add the parcelable to the intent, though, the onReceive() method fires as expected. Following are some relevant code snippets:

Parcelable Object:

public class JsonResponse implements Parcelable {

private int responseCode;
private String responseMessage;
private String errorMessage;

public JsonResponse() {

}

/*
/   Property Methods
 */
public void setResponseCode(int code) {
    this.responseCode = code;
}

public void setResponseMessage(String msg) {
    this.responseMessage = msg;
}

public void setErrorMessage(String msg) {
    this.errorMessage = msg;
}

/*
/   Parcelable Methods
 */
public static final Creator<JsonResponse> CREATOR = new Creator<JsonResponse>() {

    @Override
    public JsonResponse createFromParcel(Parcel parcel) {
        return new JsonResponse(parcel);
    }

    @Override
    public JsonResponse[] newArray(int i) {
        return new JsonResponse[i];
    }
};

private JsonResponse(Parcel parcel) {
    responseCode = parcel.readInt();
    responseMessage = parcel.readString();
    errorMessage = parcel.readString();
}

@Override
public void writeToParcel(Parcel parcel, int i) {
    parcel.writeInt(responseCode);
    parcel.writeString(responseMessage);
    parcel.writeString(errorMessage);
}

@Override
public int describeContents() {
    return 0;
}
}

onHandle() of IntentService:

protected void onHandleIntent(Intent intent) {

    service = new LoginService();
    service.login("whoever", "whatever");

    JsonResponse response = new JsonResponse();
    response.setResponseCode(service.responseCode);
    response.setResponseMessage(service.responseMessage);
    response.setErrorMessage(service.errorMessage);

    Intent i = new Intent();
    i.putExtra("jsonResponse", response);
    i.setAction(ResultsReceiver.ACTION);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    sendBroadcast(i);
}

Any ideas? Any insight would be greatly appreciated.

  • 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-10T08:05:29+00:00Added an answer on June 10, 2026 at 8:05 am

    It appears that the problem has to do with the size of the object being added as an extra. When one of the string properties of the response object grows too large, the broadcast apparently fails. I have no sources to confirm this, only some trial and error in manipulating one of the strings while leaving all other variables of the equation constant.

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

Sidebar

Related Questions

I have class that extends 'IntentService' - this class occasionally receives data from a
I have an IntentService that is parsing some xlm file to create a html
I have an IntentService that downloads some files. The problem is that I create
i have an activity (ApplicationActivity) that call an intent service (DownloadService) The intentService download
I have an IntentService which makes some web service calls. Before making these calls
i have this IntentService code which run a service once: protected void onHandleIntent(Intent intent)
i have alarm that calls my intentService every 15 min, in the intentService how
I have an IntentService which updates a preference like this: SharedPreferences.Editor editor = userPrefs.edit();
I have this widget that toggles sound on off but instead of that I
I have a service that read users data , like contact , musics ,

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.