質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

603閲覧

SurfaceViewとTextureViewを重ねて配置したい

giant

総合スコア132

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2017/09/18 08:54

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)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

AnimationSurfaceViewのコンストラクタでなんらかのエラーが発生しています。
AnimationSurfaceViewを見直しましょう。

投稿2017/09/18 09:04

yona

総合スコア18155

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

giant

2017/09/18 09:11

AutoFitTextureViewかAnimationSurfaceViewのどちらか、または両方にContext,AttributeSetを引数にとるコンストラクタを定義することで解決しました。 別の質問でyonaさんに回答してもらった内容と同じでした。 ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問