arsenewenggar
Lurker
hello guys, I'm newbie as an android programmer, Actually I have problem in my source code when I'm trying to make an application.. I'm trying to show Tab model after a button clicked. but the result is not respond..
please help me..here is the source code 
mainkubus.xml
mainkubus.java
activity in AndroidManifest
Picture
Actually I use Android 2-2 Emulator and Eclipse java Helios 32 bit on Windows 7


mainkubus.xml
<?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">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/mainkubus"
android:text="@string/mainkubus"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</FrameLayout>
</TabHost>
mainkubus.java
package org.example.hello;
import android.app.TabActivity;
import android.os.Bundle;
import android.widget.TabHost;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.content.Intent;
public class mainkubus extends TabActivity implements TabHost.TabContentFactory{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TabHost tabHost = getTabHost();
LayoutInflater.from(this).inflate(R.layout.mainkubus, tabHost.getTabContentView(),true);
tabHost.addTab(tabHost.newTabSpec("tab1")
.setIndicator("intent")
.setContent(new Intent(this, mainkubus.class)));
tabHost.addTab(tabHost.newTabSpec("tab2")
.setIndicator("intent")
.setContent(new Intent(this, mainkubus1.class)));
tabHost.addTab(tabHost.newTabSpec("tab3")
.setIndicator("destroy")
.setContent(new Intent(this, mainkubus2.class)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
tabHost.addTab(tabHost.newTabSpec("tab4")
.setIndicator("factory",
getResources().getDrawable(R.drawable.icon))
.setContent(this));
}
public View createTabContent(String tag) {
final TextView tv = new TextView(this);
tv.setText("Content for tab with tag " + tag);
return tv;
}
}
activity in AndroidManifest
<activity android:name=".mainkubus" android:label="@string/mainkubus_title"></activity>
Picture
it is the view of button
![]()
but after click a button, it doesn't work
![]()
Actually I use Android 2-2 Emulator and Eclipse java Helios 32 bit on Windows 7