I have a layout which contains an EditText input field and on top of this layout i'm popping up an AlertDialog(Advertisement). The problem is that SoftKeyBoard is not popping up when click on the EditText. Is there any work around to achieve this requirement?
Layout:
<?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:id="@+id/activity_secondary"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="inova.lk.com.librarytestapp.main.SecondaryActivity">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:layout_margin="20dp"
android:hint="Enter Name"
android:focusableInTouchMode="true"
android:layout_centerInParent="true"/>
</RelativeLayout>
AlertDialog:
final Dialog dialog = new Dialog(activity);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(inova.lk.com.inapplibrary.R.layout.custom_dialog_layout);
dialog.setCancelable(false);
Window window = dialog.getWindow();
window.setFlags(
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
);
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams wmlp = dialog.getWindow().getAttributes();
wmlp.width = Utility.dpToPx(320);
wmlp.height = Utility.dpToPx(50);
dialog.show();
UPDATE*****
I'm developing an advertisement SDK like google adz. AlertDialog is my adz banner. Banner on top of edittext layout is one scenario. Therefore I want a solution that will not require users who use my SDK to do any changes by their side.