実行中のメソッド名の取得
Log.v(TAG, new Throwable().getStackTrace()[0].getMethodName());
Google IOのあれ
Honeypad Tutorial
http://android-codelabs.appspot.com/resources/tutorials/honeypad/index.html
- 「 Intro to Honeycomb」の「Session presentation」
http://www.google.com/events/io/2011/sessions/honeycomb-highlights.html
- bootcamp
https://docs.google.com/document/pub?id=1p5-wnxA3M-LvVI2cUH5p6XltP8LUL8RFrUWGveVr3UQ&pli=1よりLab Materialsの[ Download Codelab Project Files ]
https://sites.google.com/site/iobootcamphclab/homeより1. Download the ZIP: j.mp/hcintro
- Google I/Oのセッション動画と資料
MultiChoiceDialog
public class AlertDialogMultipulChoiceActivity extends Activity { String[] ar = { "red", "green", "bule", "white" , "apple" }; boolean[] bs = new boolean[ar.length]; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void onCLickButton(View v){ AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("choice"); builder.setMultiChoiceItems(ar, bs, new OnMultiChoiceClickListener() { @Override public void onClick(DialogInterface dialog, int which, boolean isChecked) { Toast.makeText(AlertDialogMultipulChoiceActivity.this, ar[which] + ":" + isChecked, Toast.LENGTH_SHORT).show(); } }); builder.setPositiveButton("ok", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { StringBuilder sb = new StringBuilder(); for (boolean b : bs) { sb.append("" + b + System.getProperty("line.separator")); } TextView text = (TextView)findViewById(R.id.textview); text.setText(sb.toString()); } }); AlertDialog alert = builder.create(); alert.show(); } }