i followed a guide on http://developer.android.com/resources/tutorials/views/hello-webview.html and then created my own EditText field and a button. the code should explain it all, my problem is i keep getting a "HelloWebViewClient cannot be resolved to a type" Error, any suggestions? thanks in advance!
package com.text.text;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alt);
final EditText edittext = (EditText) findViewById(R.id.edittext);
final Button button = (Button) findViewById(R.id.okay);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Editable text = edittext.getText();
String Tekst = text.toString();
setContentView(R.layout.main);
WebView mWebView;
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(Tekst);
mWebView.setWebViewClient(new HelloWebViewClient());
class HelloWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
};
}
});
}}
No comments:
Post a Comment