Android: Intent- FLAG_ACTIVITY_NO_HISTORY not working
android, android-intent
Solution
Actually in your activity `C` when you are trying to re-call activity `A`, all you need to do is to clear activity-stack. For example:
Intent i = new Intent(getBaseContext(), Activity_A.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
Problem
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"; } } ```