package tjuci.edu.dl;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class First extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("第一个Activity", "我是FirstActivity");
setContentView(R.layout.main);
Button btn = (Button)findViewById(R.id.btn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
ComponentName com = new ComponentName(First.this, Second.class);
intent.setComponent(com);
startActivity(intent);
//上述代码可写为
//Intent intent = new Intent(First.this, Second.class);
//startActivity(intent);
}
});
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Android经典设计源码-Intent_ComponentSample.rar (28个子文件)
Android经典设计源码-Intent_ComponentSample
project.properties 361B
.classpath 364B
assets
src
tjuci
edu
dl
First.java 1018B
Second.java 351B
res
drawable-mdpi
ic_launcher.png 3KB
drawable-ldpi
ic_launcher.png 2KB
values
strings.xml 185B
layout
main.xml 420B
drawable-hdpi
ic_launcher.png 4KB
bin
classes
tjuci
edu
dl
Second.class 577B
R$string.class 409B
First$1.class 1KB
R$layout.class 376B
R$id.class 363B
First.class 1KB
R$attr.class 322B
R$drawable.class 389B
R.class 489B
resources.ap_ 10KB
res
drawable-mdpi
ic_launcher.png 2KB
drawable-ldpi
ic_launcher.png 2KB
drawable-hdpi
ic_launcher.png 4KB
classes.dex 3KB
Intent_ComponentSample.apk 14KB
proguard.cfg 1KB
.project 858B
AndroidManifest.xml 816B
gen
tjuci
edu
dl
R.java 733B
共 28 条
- 1
资源评论
SKCQTGZX
- 粉丝: 88
- 资源: 5818
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功