Android EditText does not bring keyboard backup if keyboard has been closed -


i have activity on app requires uses type email , password relevant fields. when activity starts first field focused , keyboard pops fine supposed happen.

but have 2 problems this:

  1. if user closes keyboard , clicks on 1 of edittext fields nothing happens, keyboard wont pop again.

  2. if user clicks anywhere outside 1 of edittext fields isn't keyboard supposed close on html mobile website.

my xml layout file

<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent" android:layout_height="fill_parent"     android:background="@drawable/home_background">      <scrollview         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:id="@+id/scrollview"         android:layout_gravity="left|top"         android:focusableintouchmode="true" >          <linearlayout             android:orientation="vertical"             android:layout_width="250dp"             android:layout_height="wrap_content"             android:layout_gravity="center">              <edittext                 android:inputtype="textemailaddress"                 android:id="@+id/email"                 android:hint="@string/email"                 style="@style/basic_field"                 android:focusable="true"                 android:focusableintouchmode="true"/>              <edittext                 android:inputtype="textpassword"                 android:id="@+id/password"                 android:hint="@string/password"                 style="@style/basic_field"                 android:focusable="true"                 android:focusableintouchmode="true" />              <button                 style = "@style/basic_button"                 android:text="@string/login"                 android:id="@+id/login_button" />              <button                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:textappearance="?android:attr/textappearancemedium"                 android:text="@string/forgot_pass"                 android:id="@+id/forgot_password"                 android:background="@android:color/transparent"                 android:textcolor="@color/red"/>              <button                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:textappearance="?android:attr/textappearancemedium"                 android:text="@string/forgot_email"                 android:id="@+id/forgot_email"                 android:background="@android:color/transparent"                 android:textcolor="@color/red" />              <button                 style = "@style/basic_button"                 android:text="@string/register"                 android:id="@+id/reg_button" />         </linearlayout>     </scrollview> </framelayout> 

my manifest file

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="uk.org.r1d.ownitall" >      <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:theme="@android:style/theme.notitlebar" >         /// main landing page         <activity             android:name=".login"             android:label="@string/app_name"             android:theme="@android:style/theme.notitlebar"             android:windowsoftinputmode="statealwayshidden">             <intent-filter>                 <action android:name="android.intent.action.main" />                 <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>         /// sign main page         <activity             android:name=".signuppage"             android:label="@string/everyspotfind"             android:theme="@android:style/theme.notitlebar"             android:windowsoftinputmode="statevisible|adjustunspecified">             <intent-filter>                 <action android:name="android.view.inputmethod" />                 <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     </application> 

i have tried adding makes no difference. , manually opening keyboarding:

edittext.setonfocuschangelistener(new onfocuschangelistener() {             @override             public void onfocuschange(view v, boolean hasfocus) {                 edittext.post(new runnable() {                     @override                     public void run() {                         inputmethodmanager imm = (inputmethodmanager) getactivity().getsystemservice(context.input_method_service);                         imm.showsoftinput(edittext, inputmethodmanager.show_implicit);                     }                 });             }         });         edittext.requestfocus();  

solution q2:hide keyboard

and please search thoroughly before creating new thread.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -