2011-9-17 12:58:21
来源:互联网 发布:软件帝国 编辑:程序博客网 时间:2024/04/28 02:29
2011-9-17 12:58:21
package com.yarin.android.Examples_03_01;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
/**
* 在Examples_02_01工程中一共使用2两个Activity,
* 前面我们知道没使用一个Activity都必须在“AndroidManifest.xml”中
* 进行声明。
*/
public class Activity01 extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
/* 设置显示main.xml布局 */
setContentView(R.layout.main);
/* findViewById(R.id.button1)取得布局main.xml中的button1 */
Button button = (Button) findViewById(R.id.button1);
/* 监听button的事件信息 */
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v)
{
/* 新建一个Intent对象 */
Intent intent = new Intent();
/* 指定intent要启动的类 */
intent.setClass(Activity01.this, Activity02.class);
/* 启动一个新的Activity */
startActivity(intent);
/* 关闭当前的Activity */
Activity01.this.finish();
}
});
}
}
布局的加载 activity 的跳转
- 2011-9-17 12:58:21
- 2011-9-17 12:21:52
- 2011-8-12 17:23:21
- 2011-9-17 18:21:33
- 2011-9-17 21:20:56
- 2011-9-17 21:22:01
- 2011-9-27 21:33:17
- 2011-9-27 21:12:09
- 2011-9-27 21:12:34
- 2011-9-17 12:24:14
- 2011-9-17 12:40:23
- 2011-9-17 12:54:43
- 2013年12月9日21:02:17
- 2011-12-21
- 2011-9-21 uml
- 2011-9-21 uml
- 2011-10-15 17:58:56
- 2011-8-9 11:58:53
- 2011-9-17 12:40:23
- 感官实现智能手机付费,可能吗?让万事达卡来告诉你吧
- 2011-9-17 12:54:43
- mfc 带滚动条的对话框 滚动条消息响应方法
- 项目经理问:为什么总是只有我在加班 – 挂包袱现象 .
- 2011-9-17 12:58:21
- Oracle笔记3(Fundamentals II)
- 分治法实现全排列
- MFC点点滴滴——Invalidate/InvalidateRect/UpdateWindow
- 运用JavaScript构建你的第一个Metro式应用程序(on Windows 8)(一)
- 有关javascript:insertAdjacentHTML和javascript:insertAdjacentElement的用法
- 优秀孩子是这样教育的
- asp.net在数据库中增加记录操作
- Android系统自带图标