android-input-method

Cannot resolve symbol showsoftinput

妖精的绣舞 提交于 2019-11-28 02:18:43
I'm trying to force the numeric keypad to show when my activity and EditText load. It seems there's a pretty straightforward answer given here and elsewhere: you say EditText yourEditText= (EditText) findViewById(R.id.yourEditText); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(yourEditText, InputMethodManager.SHOW_IMPLICIT); Fine then. So I do this and I include the imports: import android.content.Context; import android.os.Bundle; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; But when we

Behaviour of imeOptions, imeActionId and imeActionLabel

徘徊边缘 提交于 2019-11-27 19:59:02
I'm quite new to Android native development, and I'm trying to figure out how to customize the IME action buttons. I've looked at the Google documentation, but I can find very few information about the expected behaviour. From the offical guide I understand that the keyboard action button can be configured using the attributes: android:imeOptions can set the text/id of the button displayed near the space key to some pre-defined values (E.g. actionGo set the key label to Go and the id to 2) android:imeActionLabel set the label of the button displayed inside the input area when the keyboard is

How to determine the current IME in Android?

你说的曾经没有我的故事 提交于 2019-11-27 14:43:32
问题 I have an application where I would like to warn the user if they are not using the default Android softkeyboard. (i.e. they are using Swype or some thing else). How can I check which input method they currently have selected? 回答1: You can get a default IME, use: Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); 回答2: InputMethodManager has getEnabledInputMethodList() . You get an InputMethodManager from getSystemService() in your Activity . 回答3: Here's a

Android custom keyboard popup keyboard on long press

丶灬走出姿态 提交于 2019-11-27 11:17:31
问题 I have custom Android keyboard: public class CustomKeyboard extends Keyboard{...} public class CustomKeyboardView extends KeyboardView{...} public class CustomKeyboardIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener{...} On some keys, I have popupKeyboard and popupCharacters : <Key android:codes="144" android:keyLabel="0" android:popupKeyboard="@xml/key_popup" android:popupCharacters=")" android:keyEdgeFlags="right"/> xml/key_popup.xml: <Keyboard xmlns:android=

when using AlertDialog.Builder with EditText, the Soft Keyboard doesn't pop

元气小坏坏 提交于 2019-11-27 10:58:56
I am using AlertDialog.Builder in order to create an input box, with EditText as the input method. Unfortunately, the Soft Keyboard doesn't pop, although the EditText is in focus, unless you explicitly touch it again. Is there a way to force it to pop? I've tried the following, after the (AlertDialog.Builder).show(); but for no avail. InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(input, InputMethodManager.SHOW_FORCED); Anyone can help? Thanks!! grine4ka I've made such a thing AlertDialog.Builder b = new AlertDialog.Builder(this)

How to download a file from a server and save it in specific folder in SD card in Android?

丶灬走出姿态 提交于 2019-11-27 03:31:53
I have one requirement in my Android application. I need to download and save file in specific folder of SD card programmatically. I have developed source code, which is String DownloadUrl = "http://myexample.com/android/"; String fileName = "myclock_db.db"; DownloadDatabase(DownloadUrl,fileName); // and the method is public void DownloadDatabase(String DownloadUrl, String fileName) { try { File root = android.os.Environment.getExternalStorageDirectory(); File dir = new File(root.getAbsolutePath() + "/myclock/databases"); if(dir.exists() == false){ dir.mkdirs(); } URL url = new URL("http:/

Android: Determine active input method from code

Deadly 提交于 2019-11-27 01:38:31
How do you determine which input method is currently active - A user can change the input method (soft keyboard) by long pressing on a text edit field - From code, how does one determine which input method the user has chosen I realise you probably don't need this anymore, but someone might want the answer to this. You can use this line to get the String ID of the Input Method in use: String id = Settings.Secure.getString( getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD ); If you want to get more information about the current keyboard, you can use: InputMethodManager imm =

android:windowSoftInputMode=“adjustResize” doesn't make any difference?

孤街醉人 提交于 2019-11-26 21:54:36
I have a faux dialog which uses this layout: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/containerPageConatiner"> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> </FrameLayout> I place a fragment inside the <FrameLayout> depending on the dialog which

Behaviour of imeOptions, imeActionId and imeActionLabel

痴心易碎 提交于 2019-11-26 20:06:11
问题 I'm quite new to Android native development, and I'm trying to figure out how to customize the IME action buttons. I've looked at the Google documentation, but I can find very few information about the expected behaviour. From the offical guide I understand that the keyboard action button can be configured using the attributes: android:imeOptions can set the text/id of the button displayed near the space key to some pre-defined values (E.g. actionGo set the key label to Go and the id to 2)

Show soft keyboard even though a hardware keyboard is connected

拈花ヽ惹草 提交于 2019-11-26 16:07:33
问题 Is there any way to show software keyboard with USB keyboard connected (in my case RFID reader)? I tried to force show it using InputManager (with these or similar parameters), but with no luck ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED,0); Important notice - I know that there is a button in status/system bar to show it, but this button is not visible to user (Kiosk app). 回答1: You need to override the InputMethodService