do not show the keyboard automatically if open an existing event for edit

This commit is contained in:
tibbi 2016-07-05 00:20:38 +02:00
parent 862c41e693
commit 0f140aac4a
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
@ -75,6 +76,7 @@ public class EventActivity extends AppCompatActivity implements DBHelper.DBOpera
mEventEndDateTime = new DateTime(mEvent.getEndTS() * 1000L, DateTimeZone.getDefault());
mTitleET.setText(mEvent.getTitle());
mDescriptionET.setText(mEvent.getDescription());
hideKeyboard();
}
private void setupNewEvent(String dayCode) {
@ -82,6 +84,10 @@ public class EventActivity extends AppCompatActivity implements DBHelper.DBOpera
mEventEndDateTime = Formatter.getDateTimeFromCode(dayCode).withZone(DateTimeZone.getDefault()).withHourOfDay(14);
}
private void hideKeyboard() {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_event, menu);