質問編集履歴
4
誤記修正。
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,6 +98,8 @@
|
|
98
98
|
|
99
99
|
}
|
100
100
|
|
101
|
+
return view;
|
102
|
+
|
101
103
|
}
|
102
104
|
|
103
105
|
```
|
3
誤記修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
Button button = findViewById(R.id.button
|
31
|
+
Button button = findViewById(R.id.button);
|
32
32
|
|
33
33
|
|
34
34
|
|
2
誤記修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
}
|
96
96
|
|
97
|
-
}
|
97
|
+
});
|
98
98
|
|
99
99
|
}
|
100
100
|
|
1
誤記修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,6 +27,10 @@
|
|
27
27
|
setContentView(R.layout.activity_main);
|
28
28
|
|
29
29
|
|
30
|
+
|
31
|
+
Button button = findViewById(R.id.button_parent);
|
32
|
+
|
33
|
+
|
30
34
|
|
31
35
|
button.setOnClickListener(new View.OnClickListener() { // ボタンクリックでフラグメントへ
|
32
36
|
|
@@ -62,21 +66,33 @@
|
|
62
66
|
|
63
67
|
public class ParentFragment extends Fragment {
|
64
68
|
|
69
|
+
|
70
|
+
|
65
71
|
@Override
|
66
72
|
|
67
73
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
View view = inflater.inflate(R.layout.fragment_parent, container, false);
|
78
|
+
|
79
|
+
Button button2 = view.findViewById(R.id.button2);
|
80
|
+
|
81
|
+
|
68
82
|
|
69
83
|
String testStr = "テスト"; // Activityに送りたい値
|
70
84
|
|
71
85
|
|
72
86
|
|
73
|
-
button.setOnClickListener(new View.OnClickListener() { // ボタンクリックでtestStrをActivityに送りたい。
|
87
|
+
button2.setOnClickListener(new View.OnClickListener() { // ボタンクリックでtestStrをActivityに送りたい。
|
74
88
|
|
75
|
-
@Override
|
89
|
+
@Override
|
76
90
|
|
77
|
-
public void onClick(View view) {
|
91
|
+
public void onClick(View view) {
|
78
92
|
|
79
93
|
|
94
|
+
|
95
|
+
}
|
80
96
|
|
81
97
|
}
|
82
98
|
|