Background task, progress dialog, orientation change – is there any 100% working solution?

I download some data from internet in background thread (I use AsyncTask) and display a progress dialog while downloading. Orientation changes, Activity is restarted and then my AsyncTask is completed – I want to dismiss the progess dialog and start a new Activity. But calling dismissDialog sometimes throws an exception (probably because the Activity was … Read more

How do I disable orientation change on Android?

I have an application that I just would like to use in portrait mode, so I have defined android:screenOrientation=”portrait” in the manifest XML. This works OK for the HTC Magic phone (and prevents orientation changes on other phones as well). But I have a problem with the HTC G1 phone as I open the hardware … Read more