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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:14:35+00:00 2026-05-20T06:14:35+00:00

I have a service that is set to start in a separate process: <service

  • 0

I have a service that is set to start in a separate process:

<service android:name=".services.UploadService"
          android:process=":UploadServiceProcess" />

And I can successfully bind to it using bindService(). My issue occurs when I try to send a message by calling Messenger.send():

service.send(Message.obtain(null, UploadService.MESSAGE_UPLOAD_REQUEST, uploadRequest));

where uploadRequest is a custom object that implements Parcelable

public class UploadRequest implements Parcelable {
    public File file;
    public boolean deleteOnUpload;

public UploadRequest(File file, boolean deleteOnUpload) {
    this.file = file;
    this.deleteOnUpload = deleteOnUpload;
}

private UploadRequest(Parcel in) {
    this.file = new File(in.readString());
}

public int describeContents() {
    return 0;
}

public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.file.getPath());
}

public static final Parcelable.Creator<UploadRequest> CREATOR = new Parcelable.Creator<UploadRequest>() {
    public UploadRequest createFromParcel(Parcel in) {
        return new UploadRequest(in);
    }
    public UploadRequest[] newArray(int size) {
        return new UploadRequest[size];
    }
};

}

I set a breakpoint in my services handleMessage, but my app never gets to the breakpoint. However, if instead of using my custom UploadRequest object I send null, I get to the handleMessage breakpoint like I'd expect, but obviously I can't do anything at that point. I've verified file.getPath() when calling writeToParcel returns a non null String. This leads me to believe that something is off in my UploadRequest class, but from googling I can't see anything wrong with my class. Any ideas?

  • 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-20T06:14:36+00:00Added an answer on May 20, 2026 at 6:14 am

    The documentation of Message member obj says:

    An arbitrary object to send to the
    recipient. When using Messenger to
    send the message across processes this
    can only be non-null if it contains a
    Parcelable of a framework class (not
    one implemented by the application).
    For other data transfer use
    setData(Bundle). Note that Parcelable
    objects here are not supported prior
    to the FROYO release.

    My guess is you are seeing an issue because you are creating your own parcelable which is not allowed when crossing the process boundary. Instead, you’ll have to package your object into a bundle. This also means your object will need to implement Serializable but will not need to be Parcelable.

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

Sidebar

Related Questions

We have a service that has some settings that are supported only over net.tcp.
We have a service that runs methods used for data import/export at specified intervals.
I have a service that sometimes calls a batch file. The batch file takes
I have a service that I am rewriting to use threading. I understand that
I have a service that accepts callbacks from a provider. Motivation : I do
I have a web-service that I will be deploying to dev, staging and production.
I have a web service that I created in C# and a test harness
I have a WCF service that I have to reference from a .net 2.0
I have a web service that queries data from this json file, but I
We have an external service that is currently accessible via the http (port 80,

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.