Why setTimeout? I don't think we should to that. If we use setTimeout, the activity is closed before alert dialog showing.