2011-01-01から1年間の記事一覧
LayoutInfraterを利用してリソースxmlからViewを生成。 LayoutInflater inflater = (LayoutInflater)context.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View view = ifrlater.infrate(R.layout.test,null);
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…
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_…
Intentを利用したActivityの遷移です。 class MainActivity extends Activity { … public void moveToTarget() { Intent intent = new Intent(); intent.setClassName( "test.my", "test.my.TargetActivity"); startActivity(intent); }