Note Dialog: note
Syntax: note(text[, type[, global ] ])Example code:
appuifw.note(u"upload done", "conf")
This function displays a note dialog (a popup note) on your phone with
user-specified text. In the example, it displays the words ‘upload done’.
This is achieved by passing the Unicode string ‘upload done’ as the input
parameter text.
There are three possibilities for type : "info", "error" and "conf"
(see Figure 3.2). Each type shows a different symbol inside the popup note
dialog: ‘info’ shows a green exclamation mark after the text and ‘error’
shows a red exclamation mark. The default value for type is "info",
which is automatically used if type is not set.
Exercise
To see how the popup notes appear on your phone, type in the linesof code shown in Example 3 and run your script on your phone or the
emulator to see what happens.
You should see all the different popup notes appear on your phone
screen one by one.
Example 3: Various notes
Note again that we need to import the appuifw module at the beginning
of the script in order make this work.
import appuifw
appuifw.note(u"Hello")
appuifw.note(u"File not found", "error")
appuifw.note(u"Upload done", "conf")
No comments:
Post a Comment