QSL4A Documentation of
dialogCreateAlert <QSL4A API Menu>dialogCreateAlert(title=None,message=None)
Create alert dialog.
title (String) (optional)
message (String) (optional)
Example (python)
import androidhelper
droid=androidhelper.Android()
droid.dialogCreateAlert("I like swords.","Do you like swords?")
droid.dialogSetPositiveButtonText("Yes")
droid.dialogSetNegativeButtonText("No")
droid.dialogShow()
response=droid.dialogGetResponse().result
droid.dialogDismiss()
if response.has_key("which"):
result=response["which"]
if result=="positive":
print("Yay! I like swords too!")
elif result=="negative":
print("Oh. How sad.")
elif response.has_key("canceled"): # Yes, I know it's mispelled.
print("You can't even make up your mind?")
else:
print("Unknown response=",response)
print("Done")