public class MenuItemUpdater
extends java.lang.Object
implements java.lang.Runnable
MenuItem
.
This task class should be run directly on the UI thread by the context that
creates it.
this.runOnUiThread( new MenuItemUpdater( mi, sCaption, resIconID ) ) ;
Modifier and Type | Field and Description |
---|---|
protected static int |
ICON_NOT_SET
Magic value to be used for
m_resIcon when no icon should be set. |
protected android.view.MenuItem |
m_mi
The menu item to be updated.
|
protected int |
m_resIcon
The resource ID of the icon that should be used for the item.
|
protected java.lang.String |
m_sCaption
The text of the caption to be set for the item.
|
Constructor and Description |
---|
MenuItemUpdater(android.view.MenuItem mi,
android.content.Context ctx,
int resCaption)
Sets up the updater.
|
MenuItemUpdater(android.view.MenuItem mi,
android.content.Context ctx,
int resCaption,
int resIcon)
Sets up the updater.
|
MenuItemUpdater(android.view.MenuItem mi,
java.lang.String sCaption)
Sets up the updater.
|
MenuItemUpdater(android.view.MenuItem mi,
java.lang.String sCaption,
int resIcon)
Sets up the updater.
|
Modifier and Type | Method and Description |
---|---|
protected MenuItemUpdater |
init(android.view.MenuItem mi,
java.lang.String sCaption,
int resIcon)
Initializes the task instance.
|
void |
run() |
protected static final int ICON_NOT_SET
m_resIcon
when no icon should be set.protected android.view.MenuItem m_mi
protected java.lang.String m_sCaption
protected int m_resIcon
public MenuItemUpdater(android.view.MenuItem mi, java.lang.String sCaption, int resIcon)
mi
- the menu item to be updatedsCaption
- the caption to be assignedresIcon
- the icon to be assignedpublic MenuItemUpdater(android.view.MenuItem mi, java.lang.String sCaption)
mi
- the menu item to be updatedsCaption
- the icon to be assignedpublic MenuItemUpdater(android.view.MenuItem mi, android.content.Context ctx, int resCaption, int resIcon)
mi
- the menu item to be updatedctx
- a context to provide string resourcesresCaption
- the resource ID of the caption to be setresIcon
- the icon to be setpublic MenuItemUpdater(android.view.MenuItem mi, android.content.Context ctx, int resCaption)
mi
- the menu item to be updatedctx
- a context to provide string resourcesresCaption
- the resource ID of the caption to be setprotected MenuItemUpdater init(android.view.MenuItem mi, java.lang.String sCaption, int resIcon)
mi
- the menu item to be updatedsCaption
- the caption to be setresIcon
- the icon to be setpublic void run()
run
in interface java.lang.Runnable