Kostya, Thanks, that conversation can be seen here:
http://groups.google.com/group/android-developers/browse_thread/thread/07ea01892ee7a5f4/9f71428217c2cd44 However the condition is in the cancel code, which I no longer use as I am running the code in a Service so I have no need to cancel it. 2010/9/13 Kostya Vasilyev <kmans...@gmail.com> > Donal, > > Search the list: there was a post within the last month (I think) from > Romain Guy about some kind of thread race issue in AsyncTask having been > fixed in Froyo (or was it post-Froyo?) - anyway, it's somewhere in the > archives. > > -- Kostya > > 13.09.2010 16:07, Donal Rafferty пишет: > > Sorry I meant only the preExecute is run > > On Mon, Sep 13, 2010 at 1:05 PM, Donal Rafferty <draf...@gmail.com> wrote: > >> I have managed to implement the Task in my Service now but the original >> problem still remains. >> >> I dont cancel the Task at all in my service, I simply play the ringtone in >> the postExecute method of the Asynctask if a flag is true, if its not I >> dont. >> >> But I get the same issue, after a couple of runs the AsyncTask simply >> stops getting to the doInBackground method, only the postExecute method is >> run. >> >> Its very strange and really annoying me now. >> >> Is there any reason why an AsyncTask would behave like this without cancel >> being used? >> >> >> On Mon, Sep 13, 2010 at 10:58 AM, Donal Rafferty <draf...@gmail.com>wrote: >> >>> Monday morning coding! :) >>> >>> I return my aidl definition in my service's onBind: >>> >>> @Override >>> public IBinder onBind(Intent arg0) { >>> Log.d("XXX", "Status: onBind Called"); >>> return myServiceStub; >>> } >>> >>> IBinder myServiceStub = new IMyService.Stub(){ >>> >>> //aidl methods >>> >>> }; >>> >>> And use this to call methods from my Activity, so I would need to be able >>> to import android.media.Ringtone in my aidl definition but I cant. >>> >>> So I'm still stuck with it not working :( >>> >>> >>> On Mon, Sep 13, 2010 at 10:32 AM, Kostya Vasilyev <kmans...@gmail.com>wrote: >>> >>>> Donal, >>>> >>>> No, a service is a service, and a binder is a binder. >>>> >>>> The binder you get in the callback is the binder returned by the >>>> service's onBind. >>>> >>>> This example: >>>> >>>> >>>> http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalService.html >>>> >>>> has a binder implementation that returns a reference to its service, so >>>> you can do this >>>> >>>> public void onServiceConnected(ComponentName className, >>>> IBinder binder) { >>>> >>>> LocalService.LocalBinder binder = (LocalService.LocalBinder) binder; >>>> *LocalService service = binder.getService();* >>>> } >>>> >>>> This example has one flaw: it leaks a service reference (since >>>> LocalBinder is a non-static inner class of LocalService). Using a static >>>> inner or a top-level class for LocalBinder, fixes that (AFAIK). >>>> >>>> -- Kostya >>>> >>>> 13.09.2010 13:16, Donal Rafferty пишет: >>>> >>>> 09-13 10:06:53.566: ERROR/AndroidRuntime(18791): Uncaught handler: >>>> thread main exiting due to uncaught exception >>>> 09-13 10:06:53.676: ERROR/AndroidRuntime(18791): >>>> java.lang.ClassCastException: com.xxx.phone.MyService$1 >>>> 09-13 10:06:53.676: ERROR/AndroidRuntime(18791): at >>>> com.xxx.phone.ui.MyActivity$2.onServiceConnected(MyActivity.java:515) >>>> >>>> So it doesn't like the cast from binder to Service? >>>> >>>> How can I fix that do you know? What am I missing from the example? >>>> >>>> >>>> >>>> -- >>>> Kostya Vasilyev -- WiFi Manager + pretty widget -- >>>> http://kmansoft.wordpress.com >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Android Developers" group. >>>> To post to this group, send email to >>>> android-developers@googlegroups.com >>>> To unsubscribe from this group, send email to >>>> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> >>>> For more options, visit this group at >>>> http://groups.google.com/group/android-developers?hl=en >>>> >>> >>> >> > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > > > > -- > Kostya Vasilyev -- WiFi Manager + pretty widget -- > http://kmansoft.wordpress.com > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en