0

新在Android中,我已經在點擊按鈕1 4按鈕,它提供了一種新的形式... box.java如何製作標籤?

import android.os.Bundle; 
import android.content.Intent; 
import android.widget.Button; 
import android.view.View; 
import android.view.View.OnClickListener; 
public class Box extends CustomWindow { 
@Override 
    public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 


     Button b1 = (Button) findViewById(R.id.b1); 
    b1.setOnClickListener(new OnClickListener() { 
     @Override 
     public void onClick(View v) { 
     Intent intent = new Intent(); 
     intent.setClass(Box.this, Group1.class); 

     startActivity(intent); 
     } 
    }); 

    Button b2 = (Button) findViewById(R.id.b2); 
    b2.setOnClickListener(new OnClickListener() { 
     @Override 
     public void onClick(View v) { 
     Intent intent = new Intent(); 
     intent.setClass(Box.this, Group2.class); 

     startActivity(intent); 
     } 
    }); 

     Button b3 = (Button) findViewById(R.id.b3); 
    b3.setOnClickListener(new OnClickListener() { 
     @Override 
     public void onClick(View v) { 
     Intent intent = new Intent(); 
     intent.setClass(Box.this, Group3.class); 

     startActivity(intent); 
     } 
    }); 


    Button b4 = (Button) findViewById(R.id.b4); 
    b4.setOnClickListener(new OnClickListener() { 
     @Override 
     public void onClick(View v) { 
     Intent intent = new Intent(); 
     intent.setClass(Box.this, Group4.class); 

     startActivity(intent); 
     } 
    }); 

} 
} 

group1.java

import android.os.Bundle; 
public class Group1 extends CustomWindow { 
@Override 
public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.group1); 
} 
} 

問題:如何使tabhost上1組?

+0

請溫柔地對大寫字母鎖和緊急筆記 – Nanne 2011-01-19 19:57:24

回答

0

公共類group1擴展了tabactivity。 檢查文檔中的hello tablayout教程。

+0

我明白了,thx ... – priya 2011-01-20 12:32:23