Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class dialog extends Dialog implements
- android.view.View.OnClickListener {
- public Activity activity;
- public Button yes, no;
- String name;
- public dialog(Activity a) {
- super(a);
- this.activity = a;
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- setContentView(R.layout.dialog);
- yes = findViewById(R.id.btn_yes);
- no = findViewById(R.id.btn_no);
- yes.setOnClickListener(this);
- no.setOnClickListener(this);
- EditText createTable;
- createTable = findViewById(R.id.createTable);
- name = createTable.getText().toString();
- }
- @Override
- public void onClick(View v) {
- switch (v.getId()) {
- case R.id.btn_yes:
- // TODO HERE
- break;
- case R.id.btn_no:
- dismiss();
- break;
- default:
- break;
- }
- dismiss();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement