示例#1
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.data_callwordcp);

    mText = (EditText) findViewById(R.id.edittext);

    findViewById(R.id.readall).setOnClickListener(mClickListener);
    findViewById(R.id.readone).setOnClickListener(mClickListener);
    findViewById(R.id.insert).setOnClickListener(mClickListener);
    findViewById(R.id.delete).setOnClickListener(mClickListener);
    findViewById(R.id.update).setOnClickListener(mClickListener);
  }
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.input_contextmenu);

    mBtn = (Button) findViewById(R.id.button);
    registerForContextMenu(mBtn);

    mEdit = (EditText) findViewById(R.id.edittext);
    registerForContextMenu(mEdit);

    mImage = (MyImage) findViewById(R.id.myimage);
    registerForContextMenu(mImage);
  }
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    if (v == mBtn) {
      menu.setHeaderTitle("Button Menu");
      menu.add(0, 1, 0, "Red");
      menu.add(0, 2, 0, "Green");
      menu.add(0, 3, 0, "Blue");
    }

    if (v == mEdit) {
      menu.add(0, 4, 0, "번역하기");
      menu.add(0, 5, 0, "필기 인식");
    }
  }
示例#4
0
 protected void onPrepareDialog(int id, Dialog dialog) {
   super.onPrepareDialog(id, dialog);
   switch (id) {
     case SampleDialog:
       break;
     case QuestionDialog:
       Calendar calendar = Calendar.getInstance();
       String stime =
           String.format(
               "%d시 %d분 %d초",
               calendar.get(Calendar.HOUR_OF_DAY),
               calendar.get(Calendar.MINUTE),
               calendar.get(Calendar.SECOND));
       dialog.setTitle(stime);
       break;
   }
 }
示例#5
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dialog_showdialog);

    Button btn = (Button) findViewById(R.id.call);
    btn.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            showDialog(SampleDialog);
          }
        });
    Button btn2 = (Button) findViewById(R.id.call2);
    btn2.setOnClickListener(
        new Button.OnClickListener() {
          public void onClick(View v) {
            showDialog(QuestionDialog);
          }
        });
  }
示例#6
0
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   vw = new MyView(this);
   setContentView(vw);
 }
示例#7
0
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.layout_lgravity2);
 }