티스토리 뷰


<uses-permission android:name="android.permission.INTERNET" />



Select.java


package com.example.testscoket;


import android.app.Activity;

import android.content.Intent;

import android.os.Bundle;

import android.view.Menu;

import android.view.View;

import android.widget.Button;


public class Select extends Activity {


@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.select);


Button bt1 = (Button) findViewById(R.id.s);

Button bt2 = (Button) findViewById(R.id.c);


bt1.setOnClickListener(new View.OnClickListener() {


@Override

public void onClick(View v) {

// TODO Auto-generated method stub

Intent in = new Intent(Select.this, Server.class);

startActivity(in);


}

});

bt2.setOnClickListener(new View.OnClickListener() {


@Override

public void onClick(View v) {

// TODO Auto-generated method stub

Intent in = new Intent(Select.this,Client.class);

startActivity(in);

}

});

}


@Override

public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it is present.

getMenuInflater().inflate(R.menu.select, menu);

return true;

}


}



댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함