Advertisement
Guest User

Untitled

a guest
May 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public class dialog extends Dialog implements
  2. android.view.View.OnClickListener {
  3.  
  4. public Activity activity;
  5. public Button yes, no;
  6. String name;
  7.  
  8. public dialog(Activity a) {
  9. super(a);
  10. this.activity = a;
  11. }
  12.  
  13. @Override
  14. protected void onCreate(Bundle savedInstanceState) {
  15. super.onCreate(savedInstanceState);
  16. requestWindowFeature(Window.FEATURE_NO_TITLE);
  17. setContentView(R.layout.dialog);
  18.  
  19. yes = findViewById(R.id.btn_yes);
  20. no = findViewById(R.id.btn_no);
  21. yes.setOnClickListener(this);
  22. no.setOnClickListener(this);
  23.  
  24. EditText createTable;
  25. createTable = findViewById(R.id.createTable);
  26. name = createTable.getText().toString();
  27. }
  28.  
  29. @Override
  30. public void onClick(View v) {
  31. switch (v.getId()) {
  32. case R.id.btn_yes:
  33.  
  34. // TODO HERE
  35.  
  36. break;
  37. case R.id.btn_no:
  38. dismiss();
  39. break;
  40. default:
  41. break;
  42. }
  43. dismiss();
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement