When I run below code in the onPostExecute, it gives me an exception: java.lang.NullPointerException
getApplicationContext().getResources().getString(R.string.lbl_sth);
getBaseContext().getResources().getString(R.string.lbl_sth);
R.string.lbl_sth is definitely correct. If I run above two lines in onCreate, both lines work as expected.
Don't use
getBaseContext()in yourAsyncTask... pass yourActivityas a context to theAsyncTaskinstead. Then callgetResources().getString(...)on theActivitydirectly.