Attribute android:windowSoftInputMode="adjustPan" has been specified in the AndroidManifest.xml, but it works only the first time.
second time the software keyboard is shown on the screen, it entirely hides my EditText.
Image Description use the hyperlink for see the images. First time EditText woks Properly Click here hide and reopen the Keyboard Second time problem is occured.click here
Note:
1.AdjustResize instaed of AdjustPan is work but I need adjustPan because AdjustResize the image was resized.
2.I'm also tried with create Own Edittext(Custom Edittext) with PreIme that also not working for me.
3.If remove text Alignment center works proper.But I need Text Alignment Center.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:focusableInTouchMode="true"
tools:context="com.example.raj.testapp.MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:id="@+id/scroll">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#00ffffff"
android:layout_marginTop="25dp">
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:alpha=".3"
android:textColorHint="@color/black"
android:textColor="@color/black"
android:hint="Username"
android:singleLine="true"
android:textAlignment="center"
android:fontFamily="sans-serif-light"
android:id="@+id/register_email"
android:textSize="20sp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:alpha=".3"
android:textColorHint="@color/black"
android:textColor="@color/black"
android:hint="First name"
android:singleLine="true"
android:textSize="20sp"
android:id="@+id/regiter_firstname"
android:layout_marginTop="25dp"
android:fontFamily="sans-serif-light"
android:textAlignment="center"/>
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:alpha=".3"
android:textColorHint="@color/black"
android:textColor="@color/black"
android:hint="Lastname"
android:singleLine="true"
android:textSize="20sp"
android:id="@+id/regiter_lastname"
android:layout_marginTop="25dp"
android:fontFamily="sans-serif-light"
android:textAlignment="center"/>
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:alpha=".3"
android:textColorHint="@color/black"
android:textColor="@color/black"
android:singleLine="true"
android:hint="Password"
android:textSize="22sp"
android:textAlignment="center"
android:id="@+id/regiter_password"
android:inputType="textPassword"
android:layout_marginTop="25dp"
android:fontFamily="sans-serif-light"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:alpha=".3"
android:textColorHint="@color/black"
android:textColor="@color/black"
android:singleLine="true"
android:hint="Confirm Password"
android:textAlignment="center"
android:layout_marginTop="25dp"
android:textSize="20sp"
android:inputType="textPassword"
android:id="@+id/register_confirm"
android:fontFamily="sans-serif-light"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Next"
android:layout_alignParentBottom="true"
android:fontFamily="sans-serif"
android:id="@+id/register_next"
android:layout_marginTop="25dp"
android:textColor="#ffffff"
android:textAllCaps="false"
android:background="@color/yellow"/>
</RelativeLayout>
Manifest file
<activity android:name=".MainActivity"
android:configChanges="locale"
android:windowSoftInputMode="stateHidden|adjustPan">