added success dialog,onStop-onPause and tables in database