質問編集履歴
5
言語の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
###該当のソースコード
|
10
10
|
|
11
|
-
```
|
11
|
+
```Java
|
12
12
|
|
13
13
|
import android.app.Activity;
|
14
14
|
|
4
言語の記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
###該当のソースコード
|
10
10
|
|
11
|
-
```
|
11
|
+
```Android
|
12
12
|
|
13
13
|
import android.app.Activity;
|
14
14
|
|
3
コードをこのサイトの書き方で記述しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
###該当のソースコード
|
10
10
|
|
11
|
+
```ここに言語を入力
|
12
|
+
|
11
13
|
import android.app.Activity;
|
12
14
|
|
13
15
|
import android.content.Intent;
|
@@ -260,6 +262,10 @@
|
|
260
262
|
|
261
263
|
}
|
262
264
|
|
265
|
+
```
|
266
|
+
|
267
|
+
|
268
|
+
|
263
269
|
|
264
270
|
|
265
271
|
###試したこと
|
2
全文を載せました
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,6 +8,92 @@
|
|
8
8
|
|
9
9
|
###該当のソースコード
|
10
10
|
|
11
|
+
import android.app.Activity;
|
12
|
+
|
13
|
+
import android.content.Intent;
|
14
|
+
|
15
|
+
import android.os.*;
|
16
|
+
|
17
|
+
import android.content.Context;
|
18
|
+
|
19
|
+
import android.view.Display;
|
20
|
+
|
21
|
+
import android.view.View;
|
22
|
+
|
23
|
+
import android.graphics.*;
|
24
|
+
|
25
|
+
import android.view.WindowManager;
|
26
|
+
|
27
|
+
import android.widget.*;
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
import java.util.Random;
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
public class SampleInput4 extends Activity{
|
36
|
+
|
37
|
+
@Override
|
38
|
+
|
39
|
+
public void onCreate(Bundle savedInstanceState) {
|
40
|
+
|
41
|
+
super.onCreate(savedInstanceState);
|
42
|
+
|
43
|
+
putparts();
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
public void putparts() {
|
48
|
+
|
49
|
+
final SampleInput4 activity5 = this;
|
50
|
+
|
51
|
+
FrameLayout fl = new FrameLayout(this);
|
52
|
+
|
53
|
+
this.setContentView(fl);
|
54
|
+
|
55
|
+
LinearLayout ll = new LinearLayout(this);
|
56
|
+
|
57
|
+
ll.setOrientation(LinearLayout.VERTICAL);
|
58
|
+
|
59
|
+
fl.addView(ll);
|
60
|
+
|
61
|
+
TextView tv = new TextView(this);
|
62
|
+
|
63
|
+
tv.setText("画面5");
|
64
|
+
|
65
|
+
tv.setTextSize(36.0f);
|
66
|
+
|
67
|
+
ll.addView(tv);
|
68
|
+
|
69
|
+
Button btn = new Button(this);
|
70
|
+
|
71
|
+
btn.setText("Click to 画面1");
|
72
|
+
|
73
|
+
btn.setTextSize(24.0f);
|
74
|
+
|
75
|
+
ll.addView(btn);
|
76
|
+
|
77
|
+
btn.setOnClickListener(new View.OnClickListener() {
|
78
|
+
|
79
|
+
@Override
|
80
|
+
|
81
|
+
public void onClick(View view) {
|
82
|
+
|
83
|
+
activity5.button_onClick(view);
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
});
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
public void button_onClick(View view) {
|
92
|
+
|
93
|
+
startActivity(new Intent(this, MainActivity.class));
|
94
|
+
|
95
|
+
}
|
96
|
+
|
11
97
|
public class Screen extends View {
|
12
98
|
|
13
99
|
Handler hn;
|
1
コードを短くして再公開させていただきます
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
se
|
1
|
+
postDelayed();を使って描画アニメーションを作りたい
|
test
CHANGED
@@ -7,92 +7,6 @@
|
|
7
7
|
エラーメッセージも特にこれといったものはないのに動かないです。
|
8
8
|
|
9
9
|
###該当のソースコード
|
10
|
-
|
11
|
-
import android.app.Activity;
|
12
|
-
|
13
|
-
import android.content.Intent;
|
14
|
-
|
15
|
-
import android.os.*;
|
16
|
-
|
17
|
-
import android.content.Context;
|
18
|
-
|
19
|
-
import android.view.Display;
|
20
|
-
|
21
|
-
import android.view.View;
|
22
|
-
|
23
|
-
import android.graphics.*;
|
24
|
-
|
25
|
-
import android.view.WindowManager;
|
26
|
-
|
27
|
-
import android.widget.*;
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
import java.util.Random;
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
public class SampleInput4 extends Activity{
|
36
|
-
|
37
|
-
@Override
|
38
|
-
|
39
|
-
public void onCreate(Bundle savedInstanceState) {
|
40
|
-
|
41
|
-
super.onCreate(savedInstanceState);
|
42
|
-
|
43
|
-
putparts();
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
public void putparts() {
|
48
|
-
|
49
|
-
final SampleInput4 activity5 = this;
|
50
|
-
|
51
|
-
FrameLayout fl = new FrameLayout(this);
|
52
|
-
|
53
|
-
this.setContentView(fl);
|
54
|
-
|
55
|
-
LinearLayout ll = new LinearLayout(this);
|
56
|
-
|
57
|
-
ll.setOrientation(LinearLayout.VERTICAL);
|
58
|
-
|
59
|
-
fl.addView(ll);
|
60
|
-
|
61
|
-
TextView tv = new TextView(this);
|
62
|
-
|
63
|
-
tv.setText("画面5");
|
64
|
-
|
65
|
-
tv.setTextSize(36.0f);
|
66
|
-
|
67
|
-
ll.addView(tv);
|
68
|
-
|
69
|
-
Button btn = new Button(this);
|
70
|
-
|
71
|
-
btn.setText("Click to 画面1");
|
72
|
-
|
73
|
-
btn.setTextSize(24.0f);
|
74
|
-
|
75
|
-
ll.addView(btn);
|
76
|
-
|
77
|
-
btn.setOnClickListener(new View.OnClickListener() {
|
78
|
-
|
79
|
-
@Override
|
80
|
-
|
81
|
-
public void onClick(View view) {
|
82
|
-
|
83
|
-
activity5.button_onClick(view);
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
});
|
88
|
-
|
89
|
-
}
|
90
|
-
|
91
|
-
public void button_onClick(View view) {
|
92
|
-
|
93
|
-
startActivity(new Intent(this, MainActivity.class));
|
94
|
-
|
95
|
-
}
|
96
10
|
|
97
11
|
public class Screen extends View {
|
98
12
|
|
@@ -264,7 +178,7 @@
|
|
264
178
|
|
265
179
|
###試したこと
|
266
180
|
|
267
|
-
色々調べた結果、setWillNotDraw(false);を記述しました。
|
181
|
+
このコードで動かないので、色々調べた結果、setWillNotDraw(false);を記述しました。
|
268
182
|
|
269
183
|
|
270
184
|
|