I don't see a problem off-hand, though you didn't include your CREATOR
object.  We do this kind of thing extensively in the system.

On Tue, Dec 9, 2008 at 9:42 AM, DulcetTone <[EMAIL PROTECTED]> wrote:

>
> using SDK r1
>
> I have a Parcelable I am passing successfully in an AIDL call from a
> Service to the Activity that launched the Service, but which jams on
> the first parcel.readString() through the same AIDL call to a
> different Activity.
>
> Here is my interface's AIDL:
>
> ------------
> package com.me;
>
> import com.me.MyParcelable;
>
> oneway interface IMyCallbackInterface {
>    void localInput(in MyParcelable p);
> }
> ---------------
>
> Here are the boilerplate elements of MyParcelable:
>
> ------------
>        private MyParcelable(Parcel in) {
>
>                G.debug("read has size " + in.dataSize() + ", avail is " +
> in.dataAvail());
>
>                mString = in.readString();
>
>                G.debug("read string '" + s + "'");
>
>                G.debug("read has leftover " + in.dataAvail());
>       }
>
>
>        public void writeToParcel(Parcel out, int flags) {
>
>                G.debug("write string '" + mString + "' into parcel that
> already has
> " + out.dataSize());
>
>                out.writeString(mString);
>
>                G.debug("wrote " + out.dataSize());
>       }
> ----------------
>
> In the first case, where a Service calls localInput() to the Activity
> that launched it, I get the following debug output and sane operation:
>
> 12-09 01:11:58.246: INFO/System.out(1054): write string '' into parcel
> that already has 100
> 12-09 01:11:58.256: INFO/System.out(1054): wrote 108
> 12-09 01:11:58.266: INFO/System.out(1048): read has size 108, avail is
> 8
> 12-09 01:11:58.286: INFO/System.out(1048): read sender ''
> 12-09 01:11:58.286: INFO/System.out(1048): read has leftover 0
>
> In the second case, where the same Service calls the function on an
> Activity other than the one that launched it, I get the following
> debug output, and the readString() apparently never fires off despite
> the fact that there appears to be the same conditions -- 108 bytes of
> data, and 8 available before the readString() is called.
>
> 12-09 01:16:15.416: INFO/System.out(1054): write string '' into parcel
> that already has 100
> 12-09 01:16:15.416: INFO/System.out(1054): wrote 108
> 12-09 01:16:15.566: INFO/System.out(1091): read has size 108, avail is
> 8
> ---- program seems to wedge here... no further output from my code
> results
>
> Obviously, my question is:  why is this not working?
>
> I am going to try changing the interface from a oneway to a general
> one.  I'm stumped, otherwise.
>
> Thanks in advance for any insights.
>
> tone
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to