質問編集履歴
1
文の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -29,6 +29,60 @@
|
|
29
29
|
}
|
30
30
|
|
31
31
|
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
//fragmentで使っていたコード(もともとActivityのコードをFragmentように変更したのに、Activityのコードをどう書いていいかわからなくなってしまいました。Fragmentでは動いています。
|
38
|
+
|
39
|
+
```java
|
40
|
+
|
41
|
+
@Override
|
42
|
+
|
43
|
+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
44
|
+
|
45
|
+
Bundle savedInstanceState) {
|
46
|
+
|
47
|
+
return inflater.inflate(R.layout.fragment_camera2_basic, container, false);
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
@Override
|
54
|
+
|
55
|
+
public void onViewCreated(final View view, Bundle savedInstanceState) {
|
56
|
+
|
57
|
+
mTextureView = (AutoFitTextureView) view.findViewById(R.id.texture);
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
if(mTextureView==null){
|
64
|
+
|
65
|
+
Log.e(TAG,"mTextureVieがnull");
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
Log.e(TAG,"mSurfaceViewに値をセットした");
|
70
|
+
|
71
|
+
mSurfaceView = (AnimationSurfaceView) view.findViewById(R.id.surface);
|
72
|
+
|
73
|
+
Log.e(TAG,"mSurfaceViewに値をセットした");
|
74
|
+
|
75
|
+
mSurfaceView.setZOrderOnTop(true);
|
76
|
+
|
77
|
+
mSurfaceView = new AnimationSurfaceView(getActivity());
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
FrameLayout frameLayout =(FrameLayout)view.findViewById(R.id.framelayout);
|
82
|
+
|
83
|
+
frameLayout.addView(mSurfaceView, 0, new FrameLayout.LayoutParams(WC, WC));
|
84
|
+
|
85
|
+
}
|
32
86
|
|
33
87
|
```
|
34
88
|
|