|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.android.core.OneTimeDialog
public class OneTimeDialog
A class which handles showing one-off notices. This can be used for a EULA, or for "new feature" notices which show once per app version.
A benefit of this class is that it doesn't create the notice object unless it needs to be shown; most times it doesn't.
Constructor Summary | |
---|---|
OneTimeDialog(Activity parent,
java.lang.String name,
int title,
int text,
int close)
Create a dialog for showing a notice, or other warnings / disclaimers, once only. |
Method Summary | |
---|---|
protected boolean |
isAccepted()
Query whether the dialog has been shown to the user and accepted. |
void |
show()
Show the dialog unconditionally. |
void |
showFirst()
Show the dialog if this is the first program run. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OneTimeDialog(Activity parent, java.lang.String name, int title, int text, int close)
When your app starts, call showFirst()
to display
the dialog the first time your app runs. This will actually show it
if it hasn't been seen for the current version of the app.
To display the notice on demand, call show()
.
parent
- Our parent activity.name
- Name for this notice. This should be an internal
identifier; it will be used to name the preference
we use.title
- Resource ID of the dialog title.text
- Resource ID of the notice / warning text.close
- Resource ID of the close button.Method Detail |
---|
public void showFirst()
public void show()
protected boolean isAccepted()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |