[Java for Android App Development] hiphop12ism:
Hi, I was trying to make a browser. But obviously, its not working. Please help me out. I will be providing all the codes here:

Thanks in advance ...

manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.browser"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

<uses-premission android:name="android.content.permissions.INTERNET" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.browser.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.browser.ta"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.TA" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>

MainActivity.class:

package com.example.browser;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity implements OnClickListener {

EditText search = (EditText) findViewById(R.id.editText1);
WebView wb = (WebView) findViewById(R.id.webView1);
Button back = (Button) findViewById(R.id.button2);
Button forward = (Button) findViewById(R.id.button1);
Button Bsearch = (Button) findViewById(R.id.dd);
String s = search.getText().toString();
ta t = new ta();

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wb.getSettings().setBuiltInZoomControls(true);
wb.getSettings().setJavaScriptEnabled(true);
wb.getSettings().setLoadWithOverviewMode(true);
wb.getSettings().setSavePassword(true);
wb.getSettings().setAllowFileAccess(true);
back.setOnClickListener(this);
forward.setOnClickListener(this);
Bsearch.setOnClickListener(this);
wb.setWebViewClient(t);
wb.loadUrl("http://www.google.com");
}

[MENTION=439709]override[/MENTION]
public void onClick(View arg0) {
// TODO Auto-generated method stub

switch (arg0.getId()) {
case R.id.dd: // search

ProgressDialog d = ProgressDialog.show(this, "loading",
"Please wait");
wb.loadUrl("http://" + s);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(search.getWindowToken(), 0);

break;

case R.id.button2: // back
if (wb.canGoBack())
wb.goBack();

break;

case R.id.button1: // forward
if (wb.canGoForward())
wb.goForward();
break;

}

}

}

ta.class:

package com.example.browser;

import android.app.ProgressDialog;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class ta extends WebViewClient {

public boolean shouldOverrideUrlLoading(WebView v, String url) {

v.loadUrl(url);
return true;
}

}