早速の回答ありがとうございます.
無事クラスBでToastの表示ができました.
相変わらずcamera server diedがLogCatに表示されますが,これはPCのスペックの問題でしょうか.
またBuuton操作についてですが,
ButtonとSurfaceViewはRelativeLayoutでまとめて記述しているつもりです.
一番上にボタンが3つ横一列に並び,その下にtext,SiurfaceViewの画面の順で置いています.
<RelativeLayout xmlns:android="
http://schemas.android.com/apk/res/
android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1" >
<MySurfaceView //SurfaceViewのクラス
android:id="@+id/myview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/textView1" >
<MySurfaceView>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/button1"
android:onClick="onClickButton"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/button2"
android:onClick="onClickButton"/>
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.60"
android:text="@string/button3"
android:onClick="onClickButton"/>
</LinearLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout1"
android:text="TextView" />
</RelativeLayout>
最後にAndroyer jpさんのコードですが,恥ずかしながらbButtonやbButtonOnなどがわかりません.
Buttonクラスを使っていないというのは,Button btn = (Button)findViewById(id)などは使わずにできるとい
うことでしょうか.
contains()とあるのでrectangleを使っているのではないかと思いましたが,ON,OFFがわかりませんでした.
申し訳ありませんがもう少し詳しく教えていただけないでしょうか.
よろしくお願い致します.