I know about finish() method but is there a way to finish an activity completely before calling a new activity?
if you do
startActivity(intent);
finish();
You are starting a new activity before closing the previous activity completely.
Is there a way to close an activity completely before calling a new one?
Thanks a lot in advance.
EDIT: I need this because the old activity is a drawing file. The new activity is a listView activity. When a user close drawing file and start listView, that drawing file doesn’t show up in listView. When I update listView using onClickListener of a button afterwards, listView gets updated – I think this is because the previous activity which was using the file is closed completely.
I put
Intent intent = new Intent(iContext, MainActivity.class);
startActivity(intent);
at the end of the onDestroy. The listView now gets updated when the new activity shows up. Thanks for the help guys tho!