2011. 5. 19. 13:58
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
menu.add(0, 1, 0, "Update").setIcon(R.drawable.update);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch ( item.getItemId() ) {
case 1:
public boolean onCreateOptionsMenu(Menu menu)
{
menu.add(0, 1, 0, "Update").setIcon(R.drawable.update);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
switch ( item.getItemId() ) {
case 1:
InitContents();
Toast.makeText(ctx, "Update Success.", Toast.LENGTH_SHORT);
return true;
}
return false;
}
-----------------------------------------------------
menu.add(0, 1, 0, "Update").setIcon(R.drawable.update);
}
return false;
}
-----------------------------------------------------
menu.add(0, 1, 0, "Update").setIcon(R.drawable.update);
Parameters
groupId | The group identifier that this item should be part of. This can be used to define groups of items for batch state changes. Normally use NONE if an item should not be in a group. |
---|---|
itemId | Unique item ID. Use NONE if you do not need a unique ID. |
order | The order for the item. Use NONE if you do not care about the order. See getOrder() . |
title | The text to display for the item. |
'Programming > Android' 카테고리의 다른 글
Android - Bitmap resize (0) | 2011.05.27 |
---|---|
Android - 리소스 xml coding시 단위 (0) | 2011.05.25 |
Android - Webview에서 loadData할시 페이지를 찾을수 없습니다 나올때.. (0) | 2011.05.16 |
Android - sdcard에 있는 textfile읽을때 문자가 깨질시 (0) | 2011.05.16 |
Android - Activity간 데이터 주고 받기 (0) | 2011.05.13 |