Taking a Peek

 

In the sample project at http://apress.com/, you will find an amended version of the sample () with an associated menu. Since the menus are defined in Java code, the XML layout need not change and is not reprinted here.

However, the Java code has a few new behaviors, as shown here:

Public class extends

 

 

Public static final

Public static final

Public static final

Public static final

Public static final

Public static final

Public static final

 

 

Public onCreate

Super onCreate

SetContentView

SetListAdapter new this

 

FindViewById

 

RegisterForContextMenu getListView

 

 

Public onListItemClick

 

SetText

 

Public onCreateContextMenu

 

PopulateMenu

 

Public onCreateOptionsMenu

PopulateMenu

Return super onCreateOptionsMenu

 

Public onOptionsItemSelected

Return applyMenuChoice

Super onOptionsItemSelected

 

Public onContextItemSelected

Return applyMenuChoice

Super onContextItemSelected

 

 

Private populateMenu

Add

Add

Add

Add

Add

Add

Add

 

 

Private applyMenuChoice

Switch getItemId

Case

GetListView setDividerHeight

Return true

Case

GetListView setDividerHeight

Return true

Case

GetListView setDividerHeight

Return true

Case

GetListView setDividerHeight

Return true

Case

GetListView setDividerHeight








Дата добавления: 2015-05-16; просмотров: 676;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.005 сек.