質問編集履歴
1
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,45 @@
|
|
6
6
|
|
7
7
|
```java
|
8
8
|
|
9
|
+
package com.example.dentaku;
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
import android.os.Bundle;
|
14
|
+
|
15
|
+
import android.support.v7.app.AppCompatActivity;
|
16
|
+
|
17
|
+
import android.view.View;
|
18
|
+
|
19
|
+
import android.widget.TextView;
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
public class MainActivity extends AppCompatActivity {
|
24
|
+
|
25
|
+
String number = "";
|
26
|
+
|
27
|
+
TextView textview;
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
@Override
|
32
|
+
|
33
|
+
protected void onCreate(Bundle savedInstanceState) {
|
34
|
+
|
35
|
+
super.onCreate(savedInstanceState);
|
36
|
+
|
37
|
+
setContentView(R.layout.activity_main);
|
38
|
+
|
39
|
+
textview = (TextView)findViewById(R.id.tv);
|
40
|
+
|
41
|
+
textview.setText("0");
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
9
|
-
public void onClickButton0(View view){
|
47
|
+
public void onClickButton0(View view){
|
10
48
|
|
11
49
|
if (number.equals("")) return;
|
12
50
|
|
@@ -26,13 +64,93 @@
|
|
26
64
|
|
27
65
|
}
|
28
66
|
|
67
|
+
|
68
|
+
|
69
|
+
public void onClickButton2(View view){
|
70
|
+
|
71
|
+
number += "2";
|
72
|
+
|
29
|
-
|
73
|
+
textview.setText(number);
|
74
|
+
|
75
|
+
}
|
30
76
|
|
31
77
|
|
32
78
|
|
33
|
-
public void onClick
|
79
|
+
public void onClickButton3(View view){
|
34
80
|
|
81
|
+
number += "3";
|
82
|
+
|
35
|
-
|
83
|
+
textview.setText(number);
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
public void onClickButton4(View view){
|
90
|
+
|
91
|
+
number += "4";
|
92
|
+
|
93
|
+
textview.setText(number);
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
public void onClickButton5(View view){
|
100
|
+
|
101
|
+
number += "5";
|
102
|
+
|
103
|
+
textview.setText(number);
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
public void onClickButton6(View view){
|
110
|
+
|
111
|
+
number += "6";
|
112
|
+
|
113
|
+
textview.setText(number);
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
public void onClickButton7(View view){
|
120
|
+
|
121
|
+
number += "7";
|
122
|
+
|
123
|
+
textview.setText(number);
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
public void onClickButton8(View view){
|
130
|
+
|
131
|
+
number += "8";
|
132
|
+
|
133
|
+
textview.setText(number);
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
public void onClickButton9(View view){
|
140
|
+
|
141
|
+
number += "9";
|
142
|
+
|
143
|
+
textview.setText(number);
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
public void onClickDot(View view){
|
150
|
+
|
151
|
+
number += ".";
|
152
|
+
|
153
|
+
textview.setText(number);
|
36
154
|
|
37
155
|
}
|
38
156
|
|