Android soft Keyboard not open in webView` - android

I m Using WebView in AlertDialog to authenticate user to twitter.
but When i click on field in webview ,android keyboard doesnt open.
here is my code that shows how i added webview in alert dialog.
i implicitly call android keyboard but it open keyboard behind alert dialog.
here is my code.
public static void webViewDialog(final String authorizationURL, final int type)
{
final boolean correctPin;
System.out.println("In webViewDialog");
container = new LinearLayout(context);
container.setOrientation(LinearLayout.VERTICAL);
container.setMinimumWidth(200);
container.setMinimumHeight(320);
webView = new WebView(context);
webView.setMinimumWidth(200);
webView.requestFocusFromTouch();
webView.setMinimumHeight(380);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new TwitterWebViewClient());
webView.loadUrl(authorizationURL);
webView.setBackgroundColor(0xFFbbd7e9);
container.addView(webView);
Builder webDialog = new AlertDialog.Builder(context);
webDialog.setView(container).setTitle("Twitter Login")
.setPositiveButton("Ok", new DialogInterface.OnClickListener()
{
#Override
public void onClick(DialogInterface dialog, int which)
{
if (type == 0)
{
twitterPinCodeDialog();
dialog.dismiss();
}
}
}).show();
showVirtualKeyboard();
}
public static void showVirtualKeyboard()
{
Timer timer = new Timer();
timer.schedule(new TimerTask()
{
#Override
public void run()
{
InputMethodManager m = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
if(m != null)
{
// m.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
}
}
}, 100);
}

Here is my solution to this problem:
Put a dummy edit text, and set it's visibility to GONE, and add it to a containing LinearLayout, after adding the WebView to the layout.
Example:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LinearLayout wrapper = new LinearLayout(this);
WebView webView = new WebView(this);
EditText keyboardHack = new EditText(this);
keyboardHack.setVisibility(View.GONE);
webView.loadUrl(url);
wrapper.setOrientation(LinearLayout.VERTICAL);
wrapper.addView(webView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
wrapper.addView(keyboardHack, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
builder.setView(wrapper);
builder.create().show();
Once this is done, everything should work properly, and when you select an item in the WebView, the keyboard appears as expected.

I am using a PopupWindow with a WebView inside it and experienced the same problem, but if I set focusable to true in the parent the problem goes away:
popupWindow.setFocusable(true);
Hope this helps!

I had a similar issue and solved it in this way:
I override the onCreateView() method on the dialog fragment and define all view stuff configuration for my web view.
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.webview, container, false);
// do some config
// some other stuffs
loginpage.loadUrl(url);
return view;
}
On the onCreateDialog() method i just add these.
#Override
public Dialog onCreateDialog(Bundle savedInstaceState) {
Dialog dialog = super.onCreateDialog(savedInstaceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
In my case i wanted to show a dialog with no title. So due the DialogBuilder take care of creating dialog's view i decided to override the onCreateView() and just call the super.onCreateDialog() and add my window configuration.

I also suffer from this problem, I solved this problem by customizing Dialog, here is my custom dialog code, hope so this is use full for you.
TwitterDialog fb=new TwitterDialog(this);
fb.abc();
//fb.dismiss();
class TwitterDialog extends Dialog {
Context context;
String url="https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2";
public TwitterDialog(Context context) {
super(context);
this.context=context;
}
void abc(){
LinearLayout mContent = new LinearLayout(context);
mContent.setOrientation(LinearLayout.VERTICAL);
final float scale = context.getResources().getDisplayMetrics().density;
float[] dimensions =new float[]{400.0f,500.0f};
addContentView(mContent, new FrameLayout.LayoutParams(
(int) (dimensions[0] * scale + 0.5f),
(int) (dimensions[1] * scale + 0.5f)));
FrameLayout.LayoutParams FILL =
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT);
WebView mWebView = new WebView(context);
mWebView.setVerticalScrollBarEnabled(false);
mWebView.setHorizontalScrollBarEnabled(false);
mWebView.setWebViewClient(new WebClicent());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(url);
mWebView.setLayoutParams(FILL);
mContent.addView(mWebView);
TwitterDialog.this.show();
}
class WebClicent extends WebViewClient{
#Override
public void onLoadResource(WebView view, String url) {
System.out.println("onLoadResource "+url);
super.onLoadResource(view, url);
}
#Override
public void onPageFinished(WebView view, String url) {
System.out.println("onPageFinished "+url);
//TwitterDialog.this.dismiss();
super.onPageFinished(view, url);
}
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
System.out.println("onPageStarted "+url);
super.onPageStarted(view, url, favicon);
}
}
}//TWitterDialog

The reason your keyboard may not be showing up, is probably because you are using a device that already has a hard keyboard. ANY DEVICE WITH A PHYSICAL KEYBOARD does not need to show a soft keyboard... That is why it is not showing. Because your device or your emulator has a physical hard keyboard.

Related

Why sometimes Alert Dialog flickers while using webview in it

Please help me to find the solution to my problem-
I have implemented the recycler view where on clicking on the item an alert dialog opens which contains webview in which HTML data is parsed. For scrolling sometimes, I notice flickering of Alert Dialog. I don't know what exactly it is.
Thanks in Advance!
This is the glimpse to code I've written-
if(message.getCONTENT_TYPE().equals("HTML"))
{ //holder.setIsRecyclable(false);
webView= new WebView(context);
String Text="HTML Content, "+"Click to open!";
holder.messageView.setText(Text);
if(message.getMESSAGE_TYPE() == TYPE_SENT){
holder.messageView.setBackgroundResource(R.drawable.balloon_html_sent);
holder.item.setGravity(Gravity.END);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD);
}else if(message.getMESSAGE_TYPE() == TYPE_REC){
holder.messageView.setBackgroundResource(R.drawable.balloon_html_received);
holder.item.setGravity(Gravity.START);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD);
}else {
holder.messageView.setBackgroundResource(R.drawable.balloon_html_mid);
holder.item.setGravity(Gravity.CENTER_HORIZONTAL);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD_ITALIC);
}
holder.messageView.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
AlertDialog.Builder builder=new AlertDialog.Builder(context,R.style.CustomAlertDialog);
LinearLayout wrapper = new LinearLayout(context);
WebView webView = new WebView(context);
EditText keyboardHack = new EditText(context);
keyboardHack.setVisibility(View.GONE);
webView.loadData(message.getCONTENT(), "text/html", "utf-8");
wrapper.setOrientation(LinearLayout.VERTICAL);
wrapper.addView(webView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
wrapper.addView(keyboardHack, LinearLayout
.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
if(wrapper.getParent() != null) {
((ViewGroup)wrapper.getParent()).removeView(wrapper);
}
builder.setView(wrapper);
builder.create().show();
}
});
}

PopupWindow cannot display Unity3D views in Android, but Dialog does?

Here is some brief codes of my project, in which I'd like to display a Unity3D model to do something.
public class MainActivity extends FragmentActivity{
protected UnityPlayer mUnityPlayer;
#Override
protected void onCreate(Bundle savedInstanceState) {
...
getWindow().setFormat(PixelFormat.RGBX_8888);
mUnityPlayer = new UnityPlayer(this);
...
mTestImageButton = ***;
mTestImageButton.setOnClickListener(mTestImageButtonClickListener);
}
private ImageButton mTestImageButton;
private View.OnClickListener mTestImageButtonClickListener = new
View.OnClickListener() {
#Override
public void onClick(View v) {
showUnity3D_dialog(v);
//showUnity3D_popupwindow(v);
}
};
private void showUnity3D_dialog(View v) {
Dialog dialog = new Dialog(v.getContext(), R.style.move_dialog);
dialog.setContentView(mUnityPlayer);
Window window = dialog.getWindow();
window.setWindowAnimations(R.style.move_dialog);
WindowManager.LayoutParams lp = window.getAttributes();
window.setGravity(Gravity.RIGHT | Gravity.BOTTOM);
lp.width = 1179;
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
window.setAttributes(lp);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
#Override
public void onDismiss(DialogInterface dialog) {
}
});
dialog.setCanceledOnTouchOutside(true);
dialog.show();
mUnityPlayer.resume();
}
private void showUnity3D_popupwindow(View v) {
PopupWindow pop = new PopupWindow(mUnityPlayer, 1000, 800);
pop.setBackgroundDrawable(new BitmapDrawable());
pop.setFocusable(true);
pop.setOutsideTouchable(false);
pop.setOnDismissListener(new PopupWindow.OnDismissListener() {
#Override
public void onDismiss() {
}
});
pop.showAtLocation(v, Gravity.BOTTOM, 0, 0);
mUnityPlayer.resume();
}
}
As codes above, I tried to display a Unity3D-model in a PopupWindow, but the result makes me a bit confused, since there is nothing on screen when I called showUnity3D_popupwindow(v).
But when I called showUnity3D_dialog(v), the model by Unity3D shows.
I really can't understand what caused such scenario, and how can I display my model in a PopupWindow in android? Or, is it an impossible task?
I have my project under Android 4.3 & Unity 5.4.0.
Thanks a lot.
Looks like you are currently using the PopupWindow(View contentView, int width, int height) overload function. I've seen instances where functions that take View, Context or Activity does not work in Unity and you have to try other overloads.
You've tried the one takes View, now try the Context overload:
PopupWindow(Context context)
then set the width and height later on with the setWidth and setHeight function. You can get the current Context with UnityPlayer.currentActivity.getApplicationContext().
private void showUnity3D_popupwindow(View v)
{
Context mContext = UnityPlayer.currentActivity.getApplicationContext();
PopupWindow pop = new PopupWindow(mContext);
pop.setWidth(1000);
pop.setHeight(800);
pop.setBackgroundDrawable(new BitmapDrawable());
pop.setFocusable(true);
pop.setOutsideTouchable(false);
pop.setOnDismissListener(new PopupWindow.OnDismissListener() {
#Override
public void onDismiss() {
}
});
pop.showAtLocation(v, Gravity.BOTTOM, 0, 0);
mUnityPlayer.resume();
}

onBackPressed not called when PopupWindow is showing

Hee guys,
So currently I'm using a PopupWindow to display an in app browser. However when pressing the back button it does nothing. I'm using the PopupWindow in another Fragment, then I use a statement to set the PopupWindow in my FragmentActivity and then when I press my back button it should check if the PopupWindow is set or not and dismiss it or not. However it doesn't even run through the onBackPressed.
PopupWindow in fragment:
--> is where I point out the line which makes sure the FragmentActivity gets the PopupWindow as well.
// Use webview for icons and website link.
public void inAppBrowser(String url){
mCursor.moveToFirst();
// Inflate View
LayoutInflater layoutInflater = (LayoutInflater) ((MainActivity) MainActivity.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View inflatedView = layoutInflater.inflate(R.layout.browser_window, null, false);
// Control View Childs.
LinearLayout header = (LinearLayout) inflatedView.findViewById(R.id.filter_header);
header.setBackgroundColor(Color.parseColor(color));
Button cancel = (Button) inflatedView.findViewById(R.id.cancel);
Button done = (Button) inflatedView.findViewById(R.id.done);
// Set PopupWindow position.
Display display = ((MainActivity) MainActivity.getContext()).getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
// Control PopupWindow.
final PopupWindow popWindow = new PopupWindow(inflatedView, size.x, size.y, true);
popWindow.setAnimationStyle(android.R.anim.fade_in);
popWindow.setFocusable(true);
popWindow.setOutsideTouchable(true);
popWindow.showAtLocation(v, Gravity.BOTTOM, 0, 150);
--> MainActivity.setPopupWindow(popWindow);
// Control WebView
WebView myWebView = (WebView) inflatedView.findViewById(R.id.webview);
myWebView.setWebViewClient(new WebViewClientAdapter());
myWebView.clearCache(true);
myWebView.clearHistory();
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
MainActivity.setWebView(myWebView);
if (url != null) {
if (url.contains("http://") || url.contains("https://")) {
} else {
url = "http://" + url;
}
myWebView.loadUrl(url);
} else {
popWindow.dismiss();
MainActivity.setPopupWindow(null);
MainActivity.setWebView(null);
}
cancel.setVisibility(View.INVISIBLE);
done.setText("Close");
done.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
popWindow.dismiss();
}
});
}
My onBackPressed code :
#Override
public void onBackPressed() {
// TODO Auto-generated method stub
//check if popupwindow is open
Log.e(TAG, "Check if it runs through this section");
if (popWindow != null) {
if (myWebView != null && myWebView.canGoBack()) {
myWebView.goBack();
} else {
popWindow.dismiss();
popWindow = null;
myWebView = null;
}
}
}
Ignore the WebView for now. That might be a question in the future, but I want the PopupWindow to close first. Any help is appreciated.
Make your PopupWindow not focusable:
final PopupWindow popWindow = new PopupWindow(inflatedView, size.x, size.y, false);
Also remove this line which was redundant:
popWindow.setFocusable(true);
I think you should define a static method removePopupWindow(view v) in MainActivity,
and call it inside onBackPressed() like MainActivity.removePopupWindow(popWindow);
Hope It will help you.
Ok, so this question was asked a long time ago, but I think I have a better solution. What I've done is add an OnDismissListener to my popup. In this listener I've added the code I wanted to execute when the popup got dismissed. This way Android still get's to manage the opening and closing of the popup and I just added a single line to make it work.
This is the way to add one:
yourAwesomePopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
#Override
public void onDismiss() {
// Your code on dismiss here
}
});
popup.showAtLocation(popupView, Gravity.CENTER,0,0);
popupshowing=true;// define this as a global
#Override
public void onBackPressed() {
if(popupshowing) {
popup.dismiss();
popupshowing=false;
}
else {
super.onBackPressed();
}
}
You can use this.
Dialog dialog = new Dialog(ActivityMain.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST); dialog.setContentView(R.layout.mydialog);
dialog.setCancelable(true);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
#Override
public void onDismiss(DialogInterface dialog) {
try {
if (mScannerView!=null) {
mScannerView.stopCamera();
}
} catch(Exception e){
e.printStackTrace();
}
}
});

HTML5 video mediacontroller hide behind dialog

I have a webview to display html5 video, my objective is to display the video in fullscreen. In order to do this, I have to extend the WebChromeClient Class and override the method onShowCustomView and OnHideCustomView. The project I am currently working on is a library project, so the activity_main.xml is not available. Then I use a dialog to display the video in full screen. The problem is the mediacontroller is not showing. Here is my code:
#Override
public void onShowCustomView(View view, CustomViewCallback callback) {
if (customView != null){
customViewCallback = callback;
callback.onCustomViewHidden();
return;
}
root = new RelativeLayout(mContext);
customViewCallback = callback;
customView = view;
root.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
root.addView(customView,params);
Button closeBtn = new Button(mContext);
closeBtn.setText("Close");
params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_TOP);
closeBtn.setOnClickListener(new OnClickListener(){
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
onHideCustomView();
}
});
root.addView(closeBtn);
mDialog = new Dialog(mContext,android.R.style.Theme_NoTitleBar_Fullscreen);
mDialog.setContentView(root);
mDialog.show();
}
#Override
public void onHideCustomView() {
if (mDialog != null) {
mDialog.dismiss();
customViewCallback.onCustomViewHidden();
}
mDialog = null;
customView = null;
root = null;
}
customView is a View, root is a RelativeLayout and they are members of the extended WebChromeClient class. How to show the media controller, anybody helps? By the way, is there any ways to customize the media contorller in this case?

WebView in a Dialog (loading assets) and not laid out

I'm on Android 2.2 and I'm creating a dialog with a WebView inside it:
#Override
protected Dialog onCreateDialog(int id) {
Dialog dialog = new Dialog(this);
//.....
dialog.setContentView(R.layout.dialoghelp);
WebView v = (WebView)dialog.findViewById(R.id.helpWebView);
v.loadUrl("file:///android_asset/help.html");
//......
return dialog;
}
It's working, but the first time I open the dialog the WebView isn't laid out, even if the content is actually loaded.
I know this because with HierarchyViewer I can see the contents and forcing a layout request I get to see them in the emulator too. Also, if I just cancel the dialog and reopen it, everything works.
Who's wrong, Android or me? I tried putting the loading in onPrepareDialog() but it's the same.
EDIT
I changed WebView's layout params from fill_parent to wrap_content and this way it works. I can see it opening with a 0 height, then after the loading it grows up. The width worked even before.
Well I think you may need to override the Dialog class , something like what facebook sdk has implemented :-
here is there code
public class FbDialog extends Dialog {
static final int FB_BLUE = 0xFF6D84B4;
static final float[] DIMENSIONS_DIFF_LANDSCAPE = {20, 60};
static final float[] DIMENSIONS_DIFF_PORTRAIT = {40, 60};
static final FrameLayout.LayoutParams FILL =
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT);
static final int MARGIN = 4;
static final int PADDING = 2;
static final String DISPLAY_STRING = "touch";
static final String FB_ICON = "icon.png";
private String mUrl;
private DialogListener mListener;
private ProgressDialog mSpinner;
private ImageView mCrossImage;
private WebView mWebView;
private FrameLayout mContent;
public FbDialog(Context context, String url, DialogListener listener) {
super(context, android.R.style.Theme_Translucent_NoTitleBar);
mUrl = url;
mListener = listener;
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSpinner = new ProgressDialog(getContext());
mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
mSpinner.setMessage("Loading...");
requestWindowFeature(Window.FEATURE_NO_TITLE);
mContent = new FrameLayout(getContext());
/* Create the 'x' image, but don't add to the mContent layout yet
* at this point, we only need to know its drawable width and height
* to place the webview
*/
createCrossImage();
/* Now we know 'x' drawable width and height,
* layout the webivew and add it the mContent layout
*/
int crossWidth = mCrossImage.getDrawable().getIntrinsicWidth();
setUpWebView(crossWidth / 2);
/* Finally add the 'x' image to the mContent layout and
* add mContent to the Dialog view
*/
mContent.addView(mCrossImage, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
addContentView(mContent, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
}
private void createCrossImage() {
mCrossImage = new ImageView(getContext());
// Dismiss the dialog when user click on the 'x'
mCrossImage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
mListener.onCancel();
FbDialog.this.dismiss();
}
});
Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.close);
mCrossImage.setImageDrawable(crossDrawable);
/* 'x' should not be visible while webview is loading
* make it visible only after webview has fully loaded
*/
mCrossImage.setVisibility(View.INVISIBLE);
}
private void setUpWebView(int margin) {
LinearLayout webViewContainer = new LinearLayout(getContext());
mWebView = new WebView(getContext());
mWebView.setVerticalScrollBarEnabled(false);
mWebView.setHorizontalScrollBarEnabled(false);
mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(mUrl);
mWebView.setLayoutParams(FILL);
mWebView.setVisibility(View.INVISIBLE);
mWebView.getSettings().setSavePassword(false);
webViewContainer.setPadding(margin, margin, margin, margin);
webViewContainer.addView(mWebView);
mContent.addView(webViewContainer);
}
private class FbWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Util.logd("Facebook-WebView", "Redirect URL: " + url);
if (url.startsWith(Facebook.REDIRECT_URI)) {
Bundle values = Util.parseUrl(url);
String error = values.getString("error");
if (error == null) {
error = values.getString("error_type");
}
if (error == null) {
mListener.onComplete(values);
} else if (error.equals("access_denied") ||
error.equals("OAuthAccessDeniedException")) {
mListener.onCancel();
} else {
mListener.onFacebookError(new FacebookError(error));
}
FbDialog.this.dismiss();
return true;
} else if (url.startsWith(Facebook.CANCEL_URI)) {
mListener.onCancel();
FbDialog.this.dismiss();
return true;
} else if (url.contains(DISPLAY_STRING)) {
return false;
}
// launch non-dialog URLs in a full browser
getContext().startActivity(
new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
}
#Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
mListener.onError(
new DialogError(description, errorCode, failingUrl));
FbDialog.this.dismiss();
}
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Util.logd("Facebook-WebView", "Webview loading URL: " + url);
super.onPageStarted(view, url, favicon);
mSpinner.show();
}
#Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
mSpinner.dismiss();
/*
* Once webview is fully loaded, set the mContent background to be transparent
* and make visible the 'x' image.
*/
mContent.setBackgroundColor(Color.TRANSPARENT);
mWebView.setVisibility(View.VISIBLE);
mCrossImage.setVisibility(View.VISIBLE);
}
}
}

Categories

Resources