WEB开发网
开发学院手机开发Android 开发 Android Activity之间的Inter-process沟通 阅读

Android Activity之间的Inter-process沟通

 2010-06-01 15:47:00 来源:WEB开发网   
核心提示:8. import android.widget.Button;9. import android.widget.LinearLayout;10.11. public class ac01 extends Activity implements OnClickListener {12. private Button b

8. import android.widget.Button;

9. import android.widget.LinearLayout;

10.

11. public class ac01 extends Activity implements OnClickListener {

12. private Button btn, btn2, btn4;

13. public static ac01 appRef = null;

14. private final static String KKK = "AnyKey";

15.

16. @Override

17. public void onCreate(Bundle savedInstanceState) {

18. super.onCreate(savedInstanceState);

19. appRef = this;

20. setContentView(R.layout.main);

21. this.show_layout_01();

22. }

23. void show_layout_01(){

24. LinearLayout layout = new LinearLayout(this);

25. layout.setOrientation(LinearLayout.VERTICAL);

26.

27. btn = new Button(this);

28. btn.setBackgroundResource(R.drawable.water);

29. btn.setText("Edit");

30. btn.setOnClickListener(this);

31. LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(150, 40);

32. param.topMargin = 5;

33. layout.addView(btn, param);

34.

35. btn2 = new Button(this);

36. btn2.setBackgroundResource(R.drawable.x_blue);

37. btn2.setText("shared data");

38. btn2.setOnClickListener(this);

39. layout.addView(btn2, param);

40.

41. btn4 = new Button(this);

42. btn4.setBackgroundResource(R.drawable.face);

43. btn4.setText("Exit");

44. btn4.setOnClickListener(this);

45. layout.addView(btn4, param);

46. setContentView(layout);

47. }

48. @Override

49. protected void onActivityResult(int requestCode, int resultCode, Intent data)

50. {

51. SharedPreferences passwdfile = getSharedPreferences(

52. "ITEM", 0);

53. String im = passwdfile.getString("ITEM", null);

上一页  1 2 3 4 5 6 7  下一页

Tags:Android Activity 之间

编辑录入:coldstar [复制链接] [打 印]
赞助商链接