SurfaceViewとTextureViewを重ねて配置したいのですが、setContentViewで、このようなコードをsetしようとするとエラーが出ます。
xml
1 2<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:app="http://schemas.android.com/apk/res-auto" 5 android:id="@+id/root" 6 android:layout_width="match_parent" 7 android:layout_height="match_parent" 8 android:keepScreenOn="true"> 9 10 11 <com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player_view" 12 android:layout_width="match_parent" 13 android:layout_height="match_parent" 14 app:resize_mode="fixed_height" 15 /> 16 17 18 19 20 <com.google.android.exoplayer2.demo.AutoFitTextureView 21 android:id="@+id/texture" 22 android:layout_width="wrap_content" 23 android:layout_height="wrap_content" 24 android:layout_alignParentBottom="true" 25 android:layout_alignParentStart="true" 26 android:layout_alignParentTop="true" /> 27 28 <com.google.android.exoplayer2.demo.AnimationSurfaceView 29 android:id="@+id/surface" 30 android:layout_width="wrap_content" 31 android:layout_height="wrap_content" 32 android:layout_alignParentBottom="true" 33 android:layout_alignParentStart="true" 34 android:layout_alignParentTop="true" 35 android:background="#99FF0000"/> 36 37 <LinearLayout 38 android:layout_width="match_parent" 39 android:layout_height="wrap_content" 40 android:background="#00000000" 41 android:orientation="vertical"> 42 43 <LinearLayout android:id="@+id/controls_root" 44 android:layout_width="match_parent" 45 android:layout_height="wrap_content" 46 android:orientation="horizontal" 47 android:visibility="gone"> 48 </LinearLayout> 49 50 </LinearLayout> 51 52</FrameLayout> 53
java
1 Caused by: android.view.InflateException: Binary XML file line #44: Binary XML file line #44: Error inflating class com.google.android.exoplayer2.demo.AnimationSurfaceView 2 at android.view.LayoutInflater.inflate(LayoutInflater.java:539) 3 at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 4 at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 5 at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:406) 6 at android.app.Activity.setContentView(Activity.java:2228) 7 at com.google.android.exoplayer2.demo.PlayerActivity.onCreate(PlayerActivity.java:400)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/18 09:11