try the neutral button in the alert dialog box... n then in the onclick event, do message.cancel();
refer my code: AlertDialog.Builder adb = new AlertDialog.Builder(context); adb.setTitle("Error"); adb.setIcon(com.interchain.timekeeper.ui.R.drawable.alert); adb.setMessage("No Tags Entered"); adb.setNeutralButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog ad = adb.create(); ad.show(); hope this helps, cheers. On Tue, Jun 16, 2009 at 12:01 PM, androidSpb <j2ee.prasha...@gmail.com>wrote: > > Hi > > In My code I am displaying a AlertDialog based on some condition. > if(refIdList.size() < Integer.parseInt(currentassetlimit)) > { > String msg = ConstantsUtil.exceedAlertMessage; > msg = > msg.replace(":limit", String.valueOf > (currentassetlimit)); > > message.setMessage(msg); > > message.show(); > } > > Once this alert is displayed there should be a Ok button for this > dailaog and when user pressed this button user should go to previous > view. ( Same as pressing the back button in android ) > > I tried to call finish(); but its ending my activity this is not > what i want I just want to go to previous page (view). > > Somebody pls help me. > > Thanks in advance. > Prashanth > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---