Thursday, December 24, 2015

webview showing the already loaded url and not showing the presently loading URL

Hello every one,
please help me

showing the already loaded url and not showing the presently loading URL

Main activity
-------------------------
package com.example.amit.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity {
private WebView mWebView;


@override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_NO_TITLE );
mWebView = new WebView(this);
mWebView.loadUrl("**********");
mWebView.setWebViewClient(new WebViewClient() {
@override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});

this.setContentView(mWebView);
}

@override
public boolean onKeyDown(final int keyCode, final KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
-----------------------------------------------------------------------

Activity main
-----------------

xmlns:tools="not available"
android:layout_width="match_parent"
android:layout_height="match_parent"
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.amit.myapplication.Main Activity">

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/mwebView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />

-----------------------------------------------

AndroidManifest
--------------------

package="com.example.amit.myapplication">



android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">










------------------

what could be the problem ?
thanks alot for answers


via xda-developers http://ift.tt/1mhSYWA

IFTTT

Put the internet to work for you.

Turn off or edit this Recipe

No comments:

Post a Comment