1 |
package soo.ui.notify; |
---|
2 |
|
---|
3 |
import android.app.Activity; |
---|
4 |
import android.content.DialogInterface; |
---|
5 |
|
---|
6 |
import android.os.Bundle; |
---|
7 |
import android.view.View; |
---|
8 |
import android.view.View.OnClickListener; |
---|
9 |
import android.widget.Button; |
---|
10 |
import android.widget.Toast; |
---|
11 |
import android.app.AlertDialog.Builder; |
---|
12 |
|
---|
13 |
public class AlertDialog extends Activity |
---|
14 |
implements OnClickListener |
---|
15 |
{ |
---|
16 |
/** Called when the activity is first created. */ |
---|
17 |
|
---|
18 |
Button b1,b2; |
---|
19 |
|
---|
20 |
@Override |
---|
21 |
public void onCreate(Bundle savedInstanceState) { |
---|
22 |
super.onCreate(savedInstanceState); |
---|
23 |
setContentView(R.layout.main); |
---|
24 |
|
---|
25 |
b1 = (Button)findViewById(R.id.button01); |
---|
26 |
b2 = (Button)findViewById(R.id.button02); |
---|
27 |
|
---|
28 |
b1.setOnClickListener(this); |
---|
29 |
b2.setOnClickListener(this); |
---|
30 |
} |
---|
31 |
|
---|
32 |
@Override |
---|
33 |
public void onClick(View v) { |
---|
34 |
// TODO Auto-generated method stub |
---|
35 |
if(v==b1){ |
---|
36 |
Builder ad = new Builder(this); |
---|
37 |
//AlertDialog.Builder ad = new AlertDialog.Builder(this); |
---|
38 |
ad.setTitle("���李���ぉ"); |
---|
39 |
ad.setMessage("���李��댁�"); |
---|
40 |
ad.setNeutralButton("�リ린",new DialogInterface.OnClickListener() { |
---|
41 |
|
---|
42 |
@Override |
---|
43 |
public void onClick(DialogInterface dialog, int which) { |
---|
44 |
// TODO Auto-generated method stub |
---|
45 |
Toast.makeText(AlertDialog.this, "���ル�?!!", Toast.LENGTH_SHORT).show(); |
---|
46 |
//臾대� �대� �대��ㅼ�誘�� AlertDialog.this濡��댁� ���. |
---|
47 |
} |
---|
48 |
}); |
---|
49 |
ad.show(); |
---|
50 |
}else{ |
---|
51 |
Toast.makeText(this, "諛곌������!", Toast.LENGTH_SHORT).show(); |
---|
52 |
} |
---|
53 |
} |
---|
54 |
} |
---|