package com.ostrichmyself.client;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.os.Process;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
public class ClientMainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.ClientTV);
ClickAction l = new ClickAction();
tv.setOnClickListener(l);
int myProcessID = Process.myPid();
//打印当前进程的ID
Log.i("---ClientMainActivity----", myProcessID + "");
}
class ClickAction implements OnClickListener{
public void onClick(View v) {
Intent intent = new Intent("com.ostrichmyself.tiantian");
//ComponetName不描述清楚的话, 就无法正确的找到ServerActivity, 但系统提供的Activity,如main都可以为什么?
final ComponentName cn = new ComponentName("com.ostrichmyself","com.ostrichmyself.ServerActivity");
intent.setComponent(cn);
startActivity(intent);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ActivityCommunication.rar (48个子文件)
ClientApk
.project 845B
default.properties 449B
bin
com
ostrichmyself
client
R$string.class 453B
R$layout.class 412B
ClientMainActivity$ClickAction.class 1KB
ClientMainActivity.class 1KB
R$drawable.class 418B
R.class 573B
R$attr.class 358B
R$id.class 404B
ClientApk.apk 14KB
resources.ap_ 11KB
classes.dex 4KB
AndroidManifest.xml 663B
src
com
ostrichmyself
client
ClientMainActivity.java 1KB
res
values
strings.xml 185B
layout
main.xml 418B
drawable-ldpi
icon.png 2KB
drawable-hdpi
icon.png 4KB
drawable-mdpi
icon.png 3KB
.classpath 280B
gen
com
ostrichmyself
client
R.java 751B
assets
ServerApk
.project 845B
default.properties 449B
bin
ServerApk.apk 15KB
com
ostrichmyself
R$string.class 432B
R$layout.class 425B
R$drawable.class 397B
ServerMainActivity$ClickAction.class 1KB
ServerMainActivity.class 1KB
R.class 524B
R$attr.class 337B
ServerActivity.class 907B
R$id.class 413B
resources.ap_ 11KB
classes.dex 4KB
.settings
org.eclipse.jdt.core.prefs 208B
AndroidManifest.xml 849B
src
com
ostrichmyself
ServerMainActivity.java 1KB
ServerActivity.java 504B
res
values
strings.xml 179B
layout
server_gui.xml 406B
main.xml 419B
drawable-ldpi
icon.png 2KB
drawable-hdpi
icon.png 4KB
drawable-mdpi
icon.png 3KB
.classpath 280B
gen
com
ostrichmyself
R.java 852B
assets
共 48 条
- 1
资源评论
- tofumin2013-01-09不错,介绍的很清晰,谢谢了
- linzhehui2013-08-07不错,介绍清楚了,而且有例子来测试看起来才更有说服力,省得自己写代码去验证了。
x-teamer团队
- 粉丝: 1206
- 资源: 47
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功