2011-01-01から1年間の記事一覧

Android LayoutInfrater

LayoutInfraterを利用してリソースxmlからViewを生成。 LayoutInflater inflater = (LayoutInflater)context.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View view = ifrlater.infrate(R.layout.test,null);

Android Menuの表示

Menuの表示です。 public class MainActivity extends Activity { private static final int MENU_DEBUG_LOG = Menu.FIRST + 1; public boolean onCreateOptionMenu(Menu menu) { menu.add(Menu.NONE,MENU_DEBUG_LOG,Menu.NONE,"OpenLog"); return super.onC…

Android Dialogの表示

AlertDialogの表示方法です。 public class MainActivity extends Activity { public void showDialog() { nameText = new EditText(this); nameText.setHint("Enter Your Name."); nameText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_…

Android Activityの遷移

Intentを利用したActivityの遷移です。 class MainActivity extends Activity { … public void moveToTarget() { Intent intent = new Intent(); intent.setClassName( "test.my", "test.my.TargetActivity"); startActivity(intent); }