Advertisement
Guest User

Untitled

a guest
May 25th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. protected void onCreate(Bundle savedInstanceState) {
  2. super.onCreate(savedInstanceState);
  3. setContentView(R.layout.activity_registration_form);
  4. Button bt1=(Button)findViewById(R.id.btnRegister);
  5. final Dialog dialog = new Dialog(RegistrationForm.this);
  6. dialog.setContentView(R.layout.terms);
  7. final Button bt2=(Button)dialog.findViewById(R.id.proceed);
  8.  
  9. final RadioButton rb1 =(RadioButton)dialog.findViewById(R.id.Accept);
  10. final RadioButton rb2 =(RadioButton)dialog.findViewById(R.id.Decline);
  11. bt1.setOnClickListener(new View.OnClickListener() {
  12. @Override
  13. public void onClick(View v)
  14. {
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. rb2.isChecked();
  26. dialog.show();
  27.  
  28. bt2.setOnClickListener(new View.OnClickListener() {
  29. @Override
  30. public void onClick(View v) {
  31. if(rb1.isChecked()){
  32. Toast.makeText(getApplicationContext(),"You clicked acept",Toast.LENGTH_LONG).show();
  33. }
  34. else {
  35. Toast.makeText(getApplicationContext(),"you clicked reject",Toast.LENGTH_LONG).show();
  36. }
  37. }
  38. });
  39.  
  40. }
  41. });
  42.  
  43.  
  44. }
  45.  
  46. <ScrollView
  47. android:layout_width="match_parent"
  48. android:layout_height="350dp"
  49.  
  50. >
  51.  
  52.  
  53.  
  54. <LinearLayout
  55. android:layout_width="match_parent"
  56. android:layout_height="60dp"
  57. android:orientation="horizontal"
  58. >
  59.  
  60. <RadioGroup
  61. android:layout_width="match_parent"
  62. android:layout_height="wrap_content"
  63. android:orientation="horizontal"
  64. android:weightSum="1">
  65. <RadioButton
  66. android:layout_width="wrap_content"
  67. android:layout_height="wrap_content"
  68. android:id="@+id/Accept"
  69. android:text="Accept"
  70. android:clickable="true"
  71. android:textSize="20sp"
  72. android:onClick="SelectOption"
  73. />
  74. <RadioButton
  75. android:layout_width="wrap_content"
  76. android:layout_height="wrap_content"
  77. android:id="@+id/Decline"
  78. android:clickable="true"
  79. android:text="Decline"
  80. android:textSize="20sp"
  81. android:drawablePadding="20dp"
  82. android:layout_marginRight="90dp"
  83. android:onClick="SelectOption"
  84. android:checked="false" />
  85. </RadioGroup>
  86. </LinearLayout>
  87.  
  88. <Button
  89. android:layout_width=
  90. <?xml version="1.0" encoding="utf-8"?>
  91. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  92. android:orientation="vertical"
  93. android:layout_width="match_parent"
  94. android:layout_height="match_parent"
  95. >
  96. <ScrollView
  97. android:layout_width="match_parent"
  98. android:layout_height="350dp"
  99.  
  100. >
  101.  
  102. </ScrollView>
  103.  
  104.  
  105. <LinearLayout
  106. android:layout_width="match_parent"
  107. android:layout_height="60dp"
  108. android:orientation="horizontal"
  109. >
  110.  
  111. <RadioGroup
  112. android:layout_width="match_parent"
  113. android:layout_height="wrap_content"
  114. android:orientation="horizontal"
  115. android:weightSum="1">
  116. <RadioButton
  117. android:layout_width="wrap_content"
  118. android:layout_height="wrap_content"
  119. android:id="@+id/Accept"
  120. android:text="Accept"
  121. android:clickable="true"
  122. android:textSize="20sp"
  123. android:onClick="SelectOption"
  124. />
  125. <RadioButton
  126. android:layout_width="wrap_content"
  127. android:layout_height="wrap_content"
  128. android:id="@+id/Decline"
  129. android:clickable="true"
  130. android:text="Decline"
  131. android:textSize="20sp"
  132. android:drawablePadding="20dp"
  133. android:layout_marginRight="90dp"
  134. android:onClick="SelectOption"
  135. android:checked="false" />
  136. </RadioGroup>
  137. </LinearLayout>
  138.  
  139. <Button
  140. android:layout_width=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement