人力検索はてな
モバイル版を表示しています。PC版はこちら
i-mobile

Androidで独自viewを設置するとandroid.view.InflateExceptionが発生してしまいます。
ご教示頂けないでしょうか。
ビルドターゲットはAndroid 4.0.3になります。

package com.example.camerasample2;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.test_main);
}
}

package com.example.camerasample2.view;
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
省略
}

■layout XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/frameLayoutMain"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.example.camerasample2">

<com.example.camerasample2.view.CameraPreview
android:id="@+id/camera_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />

</FrameLayout>

●質問者: 匿名質問者
●カテゴリ:コンピュータ
○ 状態 :キャンセル
└ 回答数 : 0/0件

回答がありません
関連質問

●質問をもっと探す●



0.人力検索はてなトップ
8.このページを友達に紹介
9.このページの先頭へ
対応機種一覧
お問い合わせ
ヘルプ/お知らせ
ログイン
無料ユーザー登録
はてなトップ