1 |
package soo.elements.intent; |
---|
2 |
|
---|
3 |
import android.app.Activity; |
---|
4 |
import android.content.Intent; |
---|
5 |
import android.os.Bundle; |
---|
6 |
import android.view.View; |
---|
7 |
import android.view.View.OnClickListener; |
---|
8 |
import android.widget.Button; |
---|
9 |
import android.widget.EditText; |
---|
10 |
|
---|
11 |
public class SubForm extends Activity { |
---|
12 |
|
---|
13 |
Intent i; |
---|
14 |
EditText et1,et2; |
---|
15 |
@Override |
---|
16 |
public void onCreate(Bundle savedInstanceState) { |
---|
17 |
super.onCreate(savedInstanceState); |
---|
18 |
setContentView(R.layout.sub); |
---|
19 |
|
---|
20 |
i = getIntent(); //��� �≫�鍮��(SubForm)�������� ���명��몃� 援ы����. |
---|
21 |
//main��� 留���댁� 二쇰� 寃���� |
---|
22 |
Button bt = (Button)findViewById(R.id.s_button01); |
---|
23 |
bt.setOnClickListener(new OnClickListener() { |
---|
24 |
|
---|
25 |
|
---|
26 |
String name = i.getStringExtra("param_name"); |
---|
27 |
String addr = i.getStringExtra("param_addr"); |
---|
28 |
|
---|
29 |
|
---|
30 |
|
---|
31 |
@Override |
---|
32 |
public void onClick(View v) { |
---|
33 |
// TODO Auto-generated method stub |
---|
34 |
et1 = (EditText)findViewById(R.id.s_editText01); |
---|
35 |
et2 = (EditText)findViewById(R.id.s_editText02); |
---|
36 |
|
---|
37 |
i.putExtra("param_name", et1.getText().toString()); |
---|
38 |
i.putExtra("param_addr", et2.getText().toString()); |
---|
39 |
|
---|
40 |
setResult(RESULT_OK,i); //�명���諛�� |
---|
41 |
finish(); //Subform Activity媛�醫�����. |
---|
42 |
} |
---|
43 |
}); |
---|
44 |
} |
---|
45 |
} |
---|