Hi Guys,
I got the following prob:
-I have to implement an interface
-in most methods its like "show dialog and get the selected result"
-afaik in android there is no way to wait for such a result
so... that's the base;
[syntax="java"]public int showDlg()
{
int iSelectedChoice = -1;
//show Dlg
//wait for Dlg to be finished (ok or cancel is clicked)
return iSelectedChoice; //return selected choice
}[/syntax]
and my current implementation:
[syntax="java"]public int AskQuestion(String[] choices, String
strQuestion, int preSelect)
{
Dialog oDlg = null;
Builder oBuilder = new AlertDialog.Builder(this);
oBuilder.setIcon(R.drawable.cortado_icon);
oBuilder.setTitle("Question");
oBuilder.setSingleChoiceItems(choices, 0, this);
oBuilder.setPositiveButton("ok", this);
oBuilder.setNegativeButton("cancel", this);
oDlg = oBuilder.create();
oDlg.show();
while(m_fBool == false) //m_fBool is set true when a button is
clicked (in the onClicklistener)
{
try
{
Thread.sleep(100);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
return m_iResult;
}[/syntax]
In my implementation I can't see the Dialog anyway =(
Please help me, its urgent!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---