I have three activities say A B C , from activity A i go to B and and search city and from Activity B iam going to Activity c , in c iam saving something which i put in Async task and this will be saved in Activit A listview, the problem is after saving in the list when i hit back button i again see the Activity A with not saving the name which i previously saved
private class Savecity extends AsyncTask<city, String, String> {
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if(result != null && result.equals("sucess")){
Intent intent = new Intent(activity, cityActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);}
}
@Override
protected String doInBackground(city... arg0) {
try {
((CityPreferences) activity.getApplication()).createcity(arg0[0]);
return "sucess";
} catch (Exception e) {
Log.e(TAG, "", e);
return "fail";
}
}
You can implement this from your AndroidManifest.xml file, just add android:noHistory="true"
attribute in those <activity>
you want
hope this helps..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With