Hey all thanks for looking this through. I really can't understand why this happends, though it might have something to do with my background thread which is processing audioinput. All works fine until i tilt the phone, havn't yet put an landscape portrait or stuff like that in. So it should automatic just stretch my portrait layout. But it does just stretch it, it also resets my label, and makes me unable to use my setText features on them. I also noticed that it pauses my background thread. Here is code to set the 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);
}
}
Here is my xml file
<?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>