Я предлагаю использовать пользовательский диалог, определить макет XML, например:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/plausi"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/tree_normal_back"
android:padding="3dip">
<TextView
android:id="@+id/plausi_tv"
android:layout_width="fill_parent"
android:textSize="22dip"
android:padding="2dip"
android:layout_height="wrap_content"
android:background="@color/tree_normal_back"
android:textColor="@color/tree_normal_font"
android:minLines="4"/>
<EditText
android:layout_below="@+id/plausi_tv"
android:id="@+id/plausi_et"
android:layout_width="fill_parent"
android:textSize="22dip"
android:padding="2dip"
android:layout_height="wrap_content"
android:textColor="@color/tree_input_font"/>
</RelativeLayout>
и создайте диалог как:
LayoutInflater mInflater = LayoutInflater.from(tab3.this);
AlertDialog.Builder builder = new AlertDialog.Builder(tab3.this);
builder.setTitle("Plausibilitätscheck");
View convertView = mInflater.inflate(R.xml.plausi, null);
RelativeLayout rl = (RelativeLayout) convertView.findViewById(R.id.plausi);
final EditText et = (EditText) convertView.findViewById(R.id.plausi_et);
final TextView tv = (TextView) convertView.findViewById(R.id.plausi_tv);
tv.setText(Html.fromHtml(vorgabe));
et.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED);
et.setText(GlobalVars.form_adapter.DATA[clicked_index]);
et.addTextChangedListener(new TextWatcher(){
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence arg0,
int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
@Override
public void onTextChanged(CharSequence arg0,
int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}
});
builder.setView(rl);
final AlertDialog alert = builder.create();
et.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
}
});
alert.show();