Android2.2を使用してタブレット用に開発しています。
新しい編集可能なインスタンスに使用しているフォームがあります。編集可能な場合、ユーザーが特定のフィールドを編集できないようにします。私はこれをonStart
-eventで管理し、を設定しtxt.setFocusableInTouchMode(false)
ます。これにより、フォーカスが私のフォームの次のフォーカス可能なものに強制EditText
されます(これは素晴らしいです)が、実行すると、フォーカスのあるソフトキーボードが自動的に表示されEditText
ます。誰かがこれを止める方法を知っていますか?
onStart
コードは次のとおりです(イベント で呼び出されます)。
private void PopulateFields(){
TextView txtTitle = (TextView) this.findViewById(R.id.txtEquipmentEditTitle);
AutoCompleteTextView txtMake = (AutoCompleteTextView) this.findViewById(R.id.autEquipmentEditMake);
AutoCompleteTextView txtModel = (AutoCompleteTextView) this.findViewById(R.id.autEquipmentEditModel);
EditText txtDesc = (EditText) this.findViewById(R.id.txtEquipmentEditDesc);
TextView txtDeptKey = (TextView) this.findViewById(R.id.txtEquipmentEditDeptKey);
EditText txtSerial = (EditText) this.findViewById(R.id.txtEquipmentEditSerialNo);
EditText txtBarCode = (EditText) this.findViewById(R.id.txtEquipmentEditBarCode);
txtTitle.setText("Edit Equipment");
txtMake.setText(make);
txtModel.setText(model);
txtDesc.setText(desc);
txtDeptKey.setText(Integer.toString(deptKey));
txtSerial.setText(serial);
txtBarCode.setText(barCode);
txtMake.setEnabled(false);
txtModel.setEnabled(false);
txtDesc.setEnabled(false);
txtMake.setClickable(false);
txtMake.setFocusableInTouchMode(false);
txtModel.setFocusableInTouchMode(false);
txtDesc.setFocusableInTouchMode(false);
txtMake.setFocusable(false);
txtModel.setFocusable(false);
txtDesc.setFocusable(false);
}