Code example for Button

Methods: setText, setOnClickListener

0
        mLayout.setOrientation(LinearLayout.VERTICAL);
        mLayout.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
 
        mButton1 = new Button(this);
        mButton1.setText("Dialog WITHOUT EditText");//(R.string.open_dialog_scrollable);
        mButton1.setOnClickListener(new View.OnClickListener() 
        { 
            public void onClick(View v) 
            { 
                showDialog(DIALOG_WITHOUT_EDITTEXT);
            } 
        }); 
 
        mButton2 = new Button(this);
        mButton2.setText("Dialog WITH EditText");//(R.string.open_dialog_nonscrollable);
        mButton2.setOnClickListener(new View.OnClickListener() 
        { 
            public void onClick(View v) 
            {