i tried to use alertdialog for input somethings,but when i click editText system will display "W/IInputConnectionWrapper: finishComposingText on inactive InputConnection".
test1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder mBuilder = new AlertDialog.Builder(MainActivity.this);
View mView = getLayoutInflater().inflate(R.layout.dk, null);
final AlertDialog dialog = mBuilder.create();
final EditText day = (EditText) mView.findViewById(R.id.day);
final EditText month = (EditText) mView.findViewById(R.id.month);
final EditText year = (EditText) mView.findViewById(R.id.year);
final Button bu1 = (Button) mView.findViewById(R.id.bu1);
bu1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
#code
dialog.dismiss();
}
});
dialog.setView(mView);
dialog.show();
}
});
Is it possible that the EditText is wrapped inside a TextInputLayout? If so, you receive this message the moment the animation of the hint-text is finsihed.
This is not really the issue here. The issue is that the onClick is not triggered the first time for EditText views. The first click is used to set the focus on the EditText view. The second click will trigger the onClick event, which will show your dialog.
You can fix this by setting the android:focusableInTouchMode parameter of the EditText object on false
android:focusableInTouchMode="false"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With