안드로이드 어플을 만들어보려고 정말 혼자서 독학하고 있는데요.

버튼을 누르면 다른 래이아웃으로 뜨는 것을 연구하고 있는데, 인터넷 다 찾아보고 해도 잘 안되서.

결국엔, 이렇게 질문드려봅니다.

매니페스트 어플리케이션 추가로 액티비티 하나 더 만들었고요.

first Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="exam.first"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".first"
                  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="fbt"></activity>

    </application>
</manifest>

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView android:textSize="15pt" android:layout_height="wrap_content" android:id="@+id/textView1" android:layout_width="wrap_content" android:text="연결" android:layout_gravity="center_horizontal"></TextView>
<Button android:textSize="15pt" android:layout_height="wrap_content" android:text="CONNECT" android:id="@+id/button1" android:layout_width="fill_parent"></Button>
</LinearLayout>

fbt.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:orientation="vertical">
    <TextView android:textSize="15pt" android:layout_height="wrap_content" android:id="@+id/textView1" android:layout_width="wrap_content" android:text="BLUETOOTH" android:layout_gravity="center_horizontal"></TextView>
    <ProgressBar android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"></ProgressBar>
    <Button android:textSize="15pt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="종료하기" android:id="@+id/terminateActivity"></Button>
   
</LinearLayout>

first.java

package exam.first;

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

public class first extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button launch = (Button)findViewById(R.id.button1);
        launch.setOnClickListener(new Button.OnClickListener(){
 @SuppressWarnings("unused")
 public void onClick1(View v) {
  // TODO Auto-generated method stub
  Intent intent = new Intent(first.this, fbt.class); // 두번째 액티비티를 실행하기 위한 인텐트
  startActivity(intent); // 두번째 액티비티를 실행합니다.
   }

 public void onClick(View v) {
  // TODO Auto-generated method stub
  
 }
                });
    }
}

fbt.java

package exam.first;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class fbt extends Activity {

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.fbt);
     Button terminate = (Button)findViewById(R.id.terminateActivity);
     terminate.setOnClickListener(new OnClickListener(){
      @SuppressWarnings("unused")
   public void onClick1(View v) {
  // TODO Auto-generated method stub
  finish(); // 액티비티를 종료합니다.
  }

   public void onClick(View v) {
    // TODO Auto-generated method stub
    
   }  
   });     

 }
}

이렇게 짜봤고요, first에서 버튼을 누르면 fbt로 넘어가고 fbt에서 종료 버튼이 되는것을 만들어 보고 싶었습니다 ㅠㅠ

에뮬레이터를 돌리면 메인화면만 뜨고, 버튼을 무자비하게 눌러봤자 다음으로 넘어가지 않습니다. ㅠ,.ㅠ

고수 개발자 분들의 조언 좀 부탁드리겠습니다. 정말 바위에 계란치기로 도전하는 초보라 많이 힘듭니다...ㅠ,.ㅠ

부탁드릴게요...읽어주셔서 감사합니다...ㅠ