当我尝试将一个条目放入我的应用程序时,我的logcat显示此警告。可能在我的EditText处理中的某个地方抛出这个。
01-24 10:44:34.470 2404-2404/org.andrewjakevillegas.andrewjakevillegas.mymedlist W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
01-24 10:44:35.472 2404-2404/org.andrewjakevillegas.andrewjakevillegas.mymedlist W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
我有一个主要活动,调用另一个活动来添加药物条目并将其保存到数据库中。这个附加活动有一些可以捕获数据的EditTexts。
有没有人遇到过这种情况?
public class AddMed extends AppCompatActivity implements View.OnClickListener {
Button mAddMed;
EditText mDrugName2;
EditText mDose2;
EditText mRoute2;
EditText mFrequency2;
EditText mRefilldate2;
EditText mExpirationdate2;
DBAdapter dbcon;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_add_med );
dbcon = new DBAdapter(this);
mDrugName2 = (EditText) findViewById( R.id.drugName2 );
mDose2 = (EditText) findViewById( R.id.dose2 );
mRoute2 = (EditText) findViewById( R.id.route2 );
mFrequency2 = (EditText) findViewById( R.id.frequency2 );
mRefilldate2 = (EditText) findViewById( R.id.refillDate2 );
mExpirationdate2 = (EditText) findViewById( R.id.expirationDate );
mAddMed = (Button) findViewById( R.id.update );
mAddMed.setOnClickListener( this );
}
@Override
public void onClick(View v) {
InputMethodManager inputMethodManager = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE );
inputMethodManager.hideSoftInputFromWindow( mDrugName2.getWindowToken(), 0 );
switch (v.getId()){
case R.id.addMedicine:
String drugname = mDrugName2.getText().toString();
String dose = mDose2.getText().toString();
String route = mRoute2.getText().toString();
String frequency = mFrequency2.getText().toString();
String refilldate = mRefilldate2.getText().toString();
String expirationdate = mExpirationdate2.getText().toString();
dbcon.createMed( drugname, dose, route, frequency, refilldate, expirationdate );
Intent main = new Intent( AddMed.this, MedMainActivity.class );
startActivity( main );
break;
default:
break;
}
}
}