[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Skyler
activity#getApplicationContext returns the Application context, which is a reference to this class, http://developer.android.com/reference/android/app/Application.html, and is available for the livetime of your application. On Oct 26, 11:40 am, Bluemercury joao.ro...@gmail.com wrote: Also

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Skyler
I'm surprised Mark hasn't posted this yet. This may be of help to you, AsyncTask and Screen Rotation http://commonsware.com/blog/2010/09/10/asynctask-screen-rotation.html. On Oct 26, 1:18 pm, Bluemercury joao.ro...@gmail.com wrote: How so? each activity launches its own async task with its own

[android-developers] Re: AsyncTask null exception for the activity reference in the doInBackground method while rotating.

2011-10-26 Thread Skyler
attention to Mark's example project. On Oct 26, 4:58 pm, Bluemercury joao.ro...@gmail.com wrote: Hey Skyler, thanks for the link. so i need to get rid of activity reference on the doInBackground...i assume its possible to use the activity reference in the preExecute and post -- You received

[android-developers] How to detect that a MediaPlayer datasource has played its full duration

2011-10-25 Thread Skyler
Hello, I'm using a MediaPlayer instance to stream mp3s over a local proxy server. For the MediaPlayer I've registered info, error, and completion callbacks. This proxy server knows the full file length of the stream that it's downloading and it maintains the number of bytes it transferred. If

[android-developers] Confirm MediaPlayer automatic retry on streaming HTTP error

2011-05-19 Thread Skyler
Hi all, I have an app which streams mp3s from the web, proxied through a local HTTP server. At times, this local proxy server returns an HTTP error. It seems that upon receiving this error during the prepare state, the MediaPlayer makes one more attempt to stream, sending another request to the