android - keyboard not shown when alert box is popup containing a webview -
i trying make alertbox popup , display webview user can login check email. alert box working , displaying webpage. problem when want enter mu email address, no keyboard shown input.
please or suggest me alternative ways.
code alertbox:
gmail.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { alertdialog.builder alert = new alertdialog.builder(registeractivity.this); alert.settitle("check gmail"); webview wv = new webview(registeractivity.this); wv.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { switch (event.getaction()) { case motionevent.action_down: case motionevent.action_up: if (!v.hasfocus()) { v.requestfocus(); } break; } return false; } }); wv.loadurl("https://mail.google.com"); wv.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } }); alert.setview(wv); alert.setnegativebutton("close", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int id) { dialog.dismiss(); } }); alert.show(); } }); as requested xml code:
<linearlayout 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:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.example.mohalogin.registeractivity" android:background="@drawable/register" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="enter name" /> <edittext android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/edittextname" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="choose username" /> <edittext android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/edittextusername" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="choose password" /> <edittext android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputtype="textpassword" android:id="@+id/edittextpassword" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="enter email" /> <edittext android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputtype="textemailaddress" android:id="@+id/edittextemail" /> <button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="register" android:id="@+id/buttonregister" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:text="already registered" /> <button android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="login" android:id="@+id/buttonlogin" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="25dp"> <button android:id="@+id/googlemail" android:layout_width="50dp" android:layout_height="50dp" android:background="@drawable/gmail"/> <button android:id="@+id/yahoomail" android:layout_width="50dp" android:layout_height="50dp" android:background="@drawable/yahoo"/> </linearlayout> </linearlayout>
check out question , it's relative answers.
hope !!!
Comments
Post a Comment