2011-06-30 17 views
1

ボタン内にタブレイアウトを埋め込むにはどうすればいいですか?私の主なレイアウトは線形レイアウトですが、main.javaの主なクラスをどのようにプログラムするのか分かりません。誰もが私が始めるのに役立つ可能性があり、これは私のmain.javaコードは、今あなたがTabActivityクラスの助けを借りて、タブを作成することができます相対レイアウトと線形レイアウト

import android.app.Activity; 
import android.os.Bundle; 
import android.view.View; 
import android.view.View.OnClickListener; 
import android.content.Intent; 


public class Remote_DocActivity extends Activity implements OnClickListener {  
    /** Called when the activity is first created. */ 
    //private static final String TAG = "Remote_Doc"; 

    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
     View Patient_Button = findViewById(R.id.patientButton); 
     Patient_Button.setOnClickListener(this); 
     View Doctor_Button = findViewById(R.id.doctorButton); 
     Doctor_Button.setOnClickListener(this); 
     View About_Option = findViewById(R.id.aboutButton); 
     About_Option.setOnClickListener(this); 
     View Exit_Option = findViewById(R.id.exit); 
     Exit_Option.setOnClickListener(this); 

    } 
    public void onClick(View v) { 
     switch (v.getId()) { 
     case R.id.aboutButton: 
      Intent i = new Intent(this, About.class); 
      startActivity(i); 
      break; 
     case R.id.exit: 
      finish(); 
      break; 
     } 
    } 

} 
+0

ボタン内のタブレイアウトは?あなたが望むものは私には不明です、またこれを見てみてください。http://developer.android.com/resources/tutorials/views/hello-tabwidget.html – mkso

答えて

1

のように見えるものです。あなたはandroid-wireless-application-development bookのユニット3章8の例から助けを得ることができます。

関連する問題