i'm trying to make a browser app but the problem is that it doesn't connect to the internet
it's a multi tabbed so these are the codes:
main activity:
public class TabTestActivity extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost host=getTabHost();
host.addTab(host.newTabSpec("two")
.setIndicator("facebook")
.setContent(new Intent(this,facebrowser.class)));
host.addTab(host.newTabSpec("one")
.setIndicator("Google")
.setContent(new Intent(this,googlebrowser.class)));
}
}
tab1 activity:
public class facebrowser extends Activity {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
WebView browse = new WebView(this);
setContentView(browse);
browse.loadUrl("http:\\www.facebook.com");
}
}
tab2 activity:
public class googlebrowser extends Activity{
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
WebView browse = new WebView(this);
setContentView(browse);
browse.loadUrl("http:\\www.google.com");
}
}
xml layout:
<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</TabHost>
manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.x.TabBrowse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".TabTestActivity"
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="googlebrowser" android:label="name">
</activity>
<activity android:name="facebrowser" android:label="name"></activity>
</application>
</manifest>
and the pages tell me:
Web page not available
The Web page at http:/www.facebook.com might be temporarily down or it may have moved permanently to a new web address.
Here are some suggestions:
- Check to make sure your device has a signal and data connection.
- Reload this web page later.
View a cached copy of the web page from Google