I have an activity which shows a List of items from the server. When the list Item is clicked I open up another detail activity. On the detail activity Iam doing some changes back to the server. So when I press back button i want to refresh the previous activity to make sure the changes I made reflect.
This is what I do currently :-
@Override
protected void onRestart()
{
// TODO Auto-generated method stub
super.onRestart();
FetchItems fetchTask = new FetchItems();
try {
myFinalList = fetchTask.execute(registerContet).get();
}
catch (Exception e)
{
e.printStackTrace();
}
}
Everything works fine. But when I press the back button there is a UI freeze and it does not go back to the previous screen instantly. How can I solve this?