これを見てくれてありがとう。オーディオ入力を処理しているバックグラウンドスレッドと関係があるかもしれませんが、なぜこれが発生するのか本当に理解できません。電話を傾けるまではすべて正常に機能しますが、横向きのポートレートなどはまだ入れていません。したがって、ポートレートのレイアウトを自動的に拡大する必要があります。しかし、それは単にそれを引き伸ばすだけであり、それはまた私のラベルをリセットし、そしてそれらで私のsetText機能を使用することができなくなります。また、バックグラウンドスレッドが一時停止することにも気づきました。textViewsを設定するコードは次のとおりです。
private void reactOnAudioMessage(Message msg) {
TextView txtVwLastValue = (TextView) findViewById(R.id.txtVwLastValue);
String result=null;
DataFile newData=null;
Bundle bndl=msg.getData();
// ** newData getting created, with the correcy value etc this is not the problem.
if(newData!=null){
txtVwLastValue.setText("Last Value Received:" +newData.getValue());
mDataList.add(newData);
drawGraph(mImageView);
}
}
これが私のxmlファイルです
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Record"
android:id="@+id/btnRecord">
</Button>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Last Value Received:" android:id="@+id/txtVwLastValue"></TextView>
<TextView android:text="TextView" android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/txtVwType"></TextView>
<ImageView android:src="@drawable/icon" android:layout_width="fill_parent" android:id="@+id/imgViewGraph" android:layout_height="300px"></ImageView>
</LinearLayout>