Prn

hitiWI'. onCreate S?iii^jiS41 ftll',,

, ffiffJia'ttMffi render_tracks()Jjik. A-fefttf^ttllSft-l'JRrtmaWidat.

------------• • •, - ------------------------------------------------------------ ------------ --------

Fifii'jfeSliS)Jii ;ii3ctfJ$'Y'. X^ttWitfi FW/K:

private static final int MENU_NEW - Menu.FIRST ♦ 1;

private static final int MENU_CGN = MENU NEW f 1;

private static final int MENU SETTING = MENU_CON + 1;

private static final int MENU_HELPS MENU_SETTING f 1;

private static final int MENUEXIT = MENUHELPS ♦ 1;

@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu);

menu.add(0, MENU NEW, 0, R.string.menu new).setIcon(

R.drawable.new track).setAlphabeticShortcut ('N');

menu.add(0, MENU CON, 0, R.string.menu con).setlcon(

R .drawable . cor. track) . set.Al phabeticShortcut ( 'C') ;

menu.add(0, MENU SETTING, 0, R.string.menu set ting) .set Icon(

R.drawable.setting).setAlphabeticShortcut(' S ' ) ;

menu.add(0, MENU HELPS, 0, R.string.menu_helps).setlcon(

R.drawable.helps).setAlphabeticShortcut('H');

menu.add(0, MENU EXIT, 0, R.string.menu exit).set Icon<

return true; }

gOverrido public boolean onOptionsI ternSelected (Menultem item) {

Intent: intent = new Intent (); switch (item.getltemld()) • case MENU_NEW:

intent.setCIass(iTracks.this, NewTrack.class); startActivity(intent); return true; case MENU CON:

//topo: mmmftftV)«a return true; case MENU SETTING:

intent.setCIass(iTracks.this, Setting.class); startACtivity(intent); return true; case MENU_HELPS:

intent.setCIass(iTracks.this. Helps.class); startActivity(intent); case MENU EXIT: finish();

return true; )

in hf^^ffi^liltt^^^Wiuiil. it feBHJtn. x- ]• mw&mmfrm. »jwh* i ^mu J: JJH w • NJI i a im w% & ^& at

M. *i/*V:fi-ijiJ[fliIJKfI]lYj iL tvi ^Jo ^mWfju^iJir/i^J^J Uakmu NewTrack, Setting ill Helps iAJL^ Activityo

-^imv/mtM onitemciick. temmm* i^ii public void onltemClick(AdapterView<?> parent, View v, ir.t position, long id) l Log.i(TAG, "item clicked! [" + track.geLItem(position).getName() + "]"); Intent itemintent = new Intent(this, iTrack. class) ; //#J5§—'t'fi&il*) Intent Bundle b track = new Bundle 0 ; //£J3t—Bundle

Bundle *

btrack.putString("id", track.getItern(position).get Id()); b t rack.putSt ring ("name", track.getltem (posit.ion) .getNameO); b_t rack. putSt ring ("desc", track, get I tern (pos it ion.) . getDosc () ) ; iLemi ntent.putExtra("android.intent.extra.a.I bum", b_track); start Act ivi tyForResult (itemintent, 0); //fatf.l^r^JiS^J )

\imwft:

1IH h. fffH ii5U»Sril5 iTrack fa Activity. »»ftSKlft, Activity L:

SU< -ffli&M, ft Android'1', nJ"!U IN«'^ffiffiiEiJc Google Map WttflB, U'RS^HfiiA't Activity ffiSM^n MapActivity, jinftl 13-3

Kiiiite^^il "tAS'H", "l^jiiK", "ffiflMtm* Vfiiiio

hvi (UH

Was this article helpful?

0 0

Post a comment