The Busy Coder's Guide to Android Development
暂无分享,去创建一个
public class LoremBase extends ListActivity { abstract ListAdapter makeMeAnAdapter(Intent intent); private static final int LOCAL_SEARCH_ID = Menu.FIRST+1; private static final int GLOBAL_SEARCH_ID = Menu.FIRST+2; private static final int CLOSE_ID = Menu.FIRST+3; TextView selection; ArrayList items=new ArrayList(); @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); selection=(TextView)findViewById(R.id.selection); try { XmlPullParser xpp=getResources().getXml(R.xml.words); while (xpp.getEventType()!=XmlPullParser.END_DOCUMENT) { if (xpp.getEventType()==XmlPullParser.START_TAG) { if (xpp.getName().equals("word")) { items.add(xpp.getAttributeValue(0)); } } xpp.next(); } } catch (Throwable t) { Toast .makeText(this, "Request failed: "+t.toString(), 4000) .show(); } setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); onNewIntent(getIntent()); } @Override public void onNewIntent(Intent intent) { ListAdapter adapter=makeMeAnAdapter(intent); if (adapter==null) { finish(); }
[1] Avery Corman. He who laughs last , 1994 .
[2] Michael G Maihofer,et al. Reinvent the wheel. , 2005, The Journal of the Michigan Dental Association.
[3] Rolling your own , 1993 .
[4] Gareth Jones. These Are the Times That Try Men's Souls , 2008 .
[5] J. Devine. Lean and Mean , 1996 .