List of usage examples for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS
int HIDE_NOT_ALWAYS
To view the source code for android.view.inputmethod InputMethodManager HIDE_NOT_ALWAYS.
Click Source Link
From source file:org.totschnig.myexpenses.activity.ExpenseEdit.java
@Override public void onPostExecute(Object result) { if (result == null) { Toast.makeText(this, "Unknown error while saving transaction", Toast.LENGTH_SHORT).show(); return;//from w ww . ja v a 2 s . c om } Long sequenceCount = (Long) result; if (sequenceCount < 0L) { String errorMsg; switch (sequenceCount.intValue()) { case DbWriteFragment.ERROR_EXTERNAL_STORAGE_NOT_AVAILABLE: errorMsg = getString(R.string.external_storage_unavailable); break; case DbWriteFragment.ERROR_PICTURE_SAVE_UNKNOWN: errorMsg = "Error while saving picture"; break; case DbWriteFragment.ERROR_CALENDAR_INTEGRATION_NOT_AVAILABLE: mReccurenceSpinner.setSelection(0); mTransaction.originTemplate = null; errorMsg = "Recurring transactions are not available, because calendar integration is not functional on this device."; break; default: //possibly the selected category has been deleted mCatId = null; mCategoryButton.setText(R.string.select); errorMsg = "Error while saving transaction"; } Toast.makeText(this, errorMsg, Toast.LENGTH_LONG).show(); mCreateNew = false; } else { if (mRecordTemplateWidget) { recordUsage(ContribFeature.TEMPLATE_WIDGET); TemplateWidget.showContribMessage(this); } if (mCreateNew) { mCreateNew = false; if (mOperationType == MyExpenses.TYPE_SPLIT) { mTransaction = SplitTransaction.getNewInstance(mTransaction.accountId); mRowId = mTransaction.getId(); findSplitPartList().updateParent(mRowId); } else { mTransaction.setId(0L); mRowId = 0L; mReccurenceSpinner.getSpinner().setVisibility(View.VISIBLE); mReccurenceSpinner.setSelection(0); mPlanButton.setVisibility(View.GONE); } //while saving the picture might have been moved from temp to permanent mPictureUri = mTransaction.getPictureUri(); mNewInstance = true; mClone = false; switch (mOperationType) { case MyExpenses.TYPE_TRANSACTION: setTitle(R.string.menu_create_transaction); break; case MyExpenses.TYPE_TRANSFER: setTitle(R.string.menu_create_transfer); break; case MyExpenses.TYPE_SPLIT: setTitle(R.string.menu_create_split); break; } isProcessingLinkedAmountInputs = true; mAmountText.setText(""); mTransferAmountText.setText(""); isProcessingLinkedAmountInputs = false; Toast.makeText(this, getString(R.string.save_transaction_and_new_success), Toast.LENGTH_SHORT) .show(); } else { //make sure soft keyboard is closed InputMethodManager im = (InputMethodManager) this.getApplicationContext() .getSystemService(Context.INPUT_METHOD_SERVICE); im.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); Intent intent = new Intent(); intent.putExtra(ContribInfoDialogFragment.KEY_SEQUENCE_COUNT, sequenceCount); setResult(RESULT_OK, intent); finish(); //no need to call super after finish return; } } super.onPostExecute(result); }
From source file:com.tct.mail.browse.ConversationItemView.java
/** * hide the system's soft keyboard if it is active *///from ww w . ja v a 2 s .co m private void hideSoftKeyboard() { if (mContext == null) { return; } InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { if (imm.isActive()) { imm.hideSoftInputFromWindow(this.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } } }
From source file:xj.property.activity.HXBaseActivity.ChatActivity.java
/** * ??/*from w w w . j a va 2 s . com*/ */ protected void hideKeyboard() { if (getWindow().getAttributes().softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) { if (getCurrentFocus() != null) manager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }