I am iOS developer so moving to Android brought me lot surprises, here is one of them.
I download ADT from Google and created my first application. So far so good, but if a user starts rotating screen my AsyncTask is crashing because it was used previous instance of activity to display progress. I was reading AsyncTask with screen rotation - onRetainNonConfigurationInstance deprecated Okay, since I am targeting Android 2.2 and above let me try to use onRetainNonConfigurationInstance to preserve AsyncTask and pass new Activity after rotation. No way. Eclipse tell me that I can't override the method because it is defined as final in ActionBarActivity. Okay, it is fine perhaps ActionBarActivity was given me to get taste of new Androids, so I am trying to call setRetainInstance. Oops, Eclipse tells me that there is no such method in ActionBarActivity. Am I trapped? Not at all I just defined static variable to keep my AsyncTask reference and everything works like a charm. Now tell me how do you solve a similar problem?