android-input-method

Android: Backspace in WebView/BaseInputConnection

夙愿已清 提交于 2019-12-17 06:43:49
问题 I have a problem with soft keyboard backspace in Android (4.2). I have a custom editor in a WebView (CodeMirror), which uses an empty <textarea> internally. It seems that backspace is not sent by an Android system unless it believes there is some text in the <textarea> . I have overridden WebView onCreateInputConnection in an attempt to dumb down soft input: @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { Log.d("CustomWebView", "onCreateInputConnection(...)");

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

情到浓时终转凉″ 提交于 2019-12-17 04:54:27
问题 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

Monodroid - EditText input method won't accept numbers

别说谁变了你拦得住时间么 提交于 2019-12-14 01:40:27
问题 I am having some very strange problems with the EditText control in Mono for Android. My solution is targeting 2.3 and I am debugging on a T Mobile VivaCity. Here is my AXML for the EditText <EditText android:inputType="text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/ctl_searchText" /> When I show the View containing the EditText the keyboard automatically appears, this is not a problem. The problem is I can't enter any numbers by tapping the

Making an EditText object accept only numeric values

筅森魡賤 提交于 2019-12-13 05:36:56
问题 I'd like to create programatically an EditText within this attribute: android:inputType="number|numberSigned|numberDecimal" In brief I'd like it to accept only numeric values. How do I have to set my EditText object? 回答1: The corresponding method for inputType is public void setInputType (int type) So something like the below should work (untested) setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL ) 来源: https://stackoverflow.com

java.lang.SecurityException: without permission android.permission.BIND_INPUT_METHOD only for <=2.2

本秂侑毒 提交于 2019-12-12 15:47:19
问题 I have this very unpeculiar exception.The thing is have i have this app that has a button to start InputMethodService that starts like this public class MyGroovyIme extends InputMethodService { and this is how it looks in manifest. <service android:name=".MyGroovyIme" android:enabled="true" android:exported="true" android:permission="android.permission.BIND_INPUT_METHOD" > <intent-filter> <action android:name="android.view.InputMethod" /> <!-- <category android:name="android.intent.category

Is it possible to add animated emoji in android messaging

拥有回忆 提交于 2019-12-12 14:47:57
问题 I am developing an emoji keyboard for android but don't know how to add a animated emoji in currentInputConnection of InputMethodService . Edittext content= findVie...... sb = new SpannableStringBuilder(); String dummyText = "-"; sb.append(dummyText); try { sb.setSpan(anim = new AnimatedImageSpan(new AnimatedGifDrawable( getAssets().open("54.gif"), new AnimatedGifDrawable.UpdateListener() { @Override public void update() { content.requestLayout(); content.invalidate(); } })), sb.length() -

How to use InputMethodService in wifi p2p service discovery?

风流意气都作罢 提交于 2019-12-12 01:56:17
问题 I am new to android, please tell me if inputMethodService can work with wifi p2p service discovery? I want one phone to act as a keyboard for another phone. Please tell me if it is possible and which resources to refer in order to begin with it. Thank you. 回答1: I think what you need to do is not worry about the input-method in the first device, but create an application where you input text as normal from what ever you are using for input on the android device and then make that application

InputConnection text committing not working

♀尐吖头ヾ 提交于 2019-12-11 14:24:57
问题 In my onCreateInputView of InputMethodService I have a BroadcastReceiver, that listens for events from my application. My BroadcastReceiver get the text and try to insert into current text field.problem is text never inserted into the current textfield everthing working fine except text not inseted in editText filed. Here I am posting my code snippset @Override public View onCreateInputView() { kv = (KeyboardView) getLayoutInflater().inflate(R.layout.activity_main, null); keyboard = new

How to commit composing text to an InputConnection when the user changes the selection

一曲冷凌霜 提交于 2019-12-11 07:33:07
问题 I am making a custom keyboard and have to set composing text before committing it. This is described in this Q&A. I know how to commit text in general inputConnection.commitText("text", 1); But I don't know how to commit it if the user changes the cursor location by touching another part of the EditText . From observing other keyboards I know it is possible because they do it. But in my keyboard if I have inputConnection.setComposingText("text", 1); and then change the cursor position, the

Soft keyboard not open in android [duplicate]

别等时光非礼了梦想. 提交于 2019-12-11 04:22:09
问题 This question already has answers here : Android: softkeyboard not showing up (5 answers) Closed 3 years ago . I am newbie to android and working on a demo app,In that i am having an activity contains an edittext at the top of the screen and want to show the keyboard on the start of that activity i have tried many ways but none of this works,Can anybudy help me to sort it ot? layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res