*

【android】IMEの表示/非表示

公開日: : 最終更新日:2012/12/05 android

//IMEを閉じる
InputMethodManager inputMethodManager =  (InputMethodManager)act.getSystemService(Context.INPUT_METHOD_SERVICE);  
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), 0);
//IMEを表示 
EditText et = (EditText)findViewById(R.id.edittext);

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);  
imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);

関連記事

no image

【android】 Android4.1のserviceでdefaultPreferenceがおかしい

【現象】 ActivityでdefaultPreferencesで保存したデータがservice内

記事を読む

no image

ダイアログを表示する

カスタムアラートダイアログ private void showCustomAlert(A

記事を読む

no image

【android】設定画面の作成

res/xml/preferences.xml <?xml version=&quo

記事を読む

no image

【android】ハードウェアキー入力を検出する

Activityを継承したクラスで下記を記述します。 public boolean

記事を読む

no image

【android】言語・地域設定の取得

androidでは利用する言語と国名がjava.util.Localeのオブジェクトとして設定されて

記事を読む

no image

【android】処理時間を計測する

パフォーマンスのリファクタリングを行うには処理時間の計測がかかせません。 SDK標準のクラスを使っ

記事を読む

no image

【android】オーバーレイでトップレイヤーにViewを表示する

常にホーム画面や他のアプリより前面にViewを表示する方法です。 前面に透明のViewGroupを

記事を読む

no image

【android】DrawableとBitmap、リソースの相互変換 

Resource → Bitmap Bitmap bm = BitmapFactory.dec

記事を読む

no image

【android】スリープモードに入らせない

Androidでは一定時間、操作をしないとスリープモードに入って待機状態になってしまいますが、動

記事を読む

no image

【android】 webviewでassetsのリソースを使用する

webviewでassets内のリソースにアクセスするには file:///android_a

記事を読む

Message

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

no image
知らないと損をする6つのライセンスまとめ

オープンソースやフリーウェア、フリー素材などが巷に溢れ、それらを利用す

no image
ガリレオ:ニュースブラウザをリリースしました。

概要 ガリレオはニュースを読んだり、検索する機能に特化したブラウザア

no image
【android】Activityとプロセスのライフサイクル

またもやライフサイクル周りでハマったのですが、Androidのライフサ

→もっと見る

PAGE TOP ↑