android - installation-like form dialog box -
i've got problem dialog box. i'd installation-like form asks question type / choose option. @ moment did simple dialog box shows layout spinner. ideas should create new dialog box on "next" button (or maybe somehow change layout of current dialog box?) asks next question?
picture:
my code:
public class dialog_box extends sherlockdialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { final alertdialog.builder builder = new alertdialog.builder(getactivity()); final layoutinflater inflater = getactivity().getlayoutinflater(); builder.setview(inflater.inflate(r.layout.my_layout, null)); builder .settitle("question i") .setpositivebutton(r.string.next, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { } }) .setnegativebutton(r.string.cancel, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { } }); return builder.create(); } }
you this:
implement function creates dialog , receives int
question number
createdialog(int questionnumber)
in function can have switch-case
title , content, , after switch
set next button call
dismiss(); createdialog(++questionnumber);
this close current one, , construct next one.
the first 1 can call different button using createdialog(0);
also, @ beginning of method, should check if last one, assuming have 5 dialogs:
max_dialogs = 5; if (questionnumber >= max_dialogs) { return; }
you still have code every dialog, there's no getting around it.
Comments
Post a Comment