两个Activity之间的转换和值传递和发短信程序
来源:互联网 发布:淘宝店铺生成app 编辑:程序博客网 时间:2024/06/14 18:26
public class Activity02 extends Activity implements OnClickListener {
private Button myButton = null;
private TextView myTextView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myTextView = (TextView)this.findViewById(R.id.mainTextView);
myTextView.setText(R.string.main);
myButton = (Button)this.findViewById(R.id.myButton);
myButton.setText("点击转向第二个页面");
myButton.setOnClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity02, menu);
return true;
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
/* Intent intent = new Intent();
intent.putExtra("testIntent", "laizhibing");
intent.setClass(Activity02.this,OtherActivity.class);
Activity02.this.startActivity(intent);
*/
//下面是发短信的代码
Uri uri = Uri.parse("smsto://00000123");
Intent intent = new Intent(Intent.ACTION_SENDTO,uri);
intent.putExtra("sms_body", "zhibing");
Activity02.this.startActivity(intent);
}
}
OtherActivity
public class OtherActivity extends Activity {
private TextView textView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_other);
Intent intent = getIntent();
String value = intent.getStringExtra("testIntent");
textView = (TextView)this.findViewById(R.id.otherTextview);
textView.setText(value);
//textView.setText(R.string.otherText);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.other, menu);
return true;
}
}
- 两个Activity之间的转换和值传递和发短信程序
- fragment和activity之间的数据传递
- Fragment和Activity之间的数据传递
- Activity和Fragment之间的数据传递
- Activity 和 Fragment 之间的数据传递
- Fragment和Activity之间的数据传递
- 用Intent 对象实现两个(多个)Activity之间的跳转和参数传递
- 调用ios系统的拨号程序和发短信程序
- activity和activity之间传递对象,fragment和fragment之间传递对象的方法
- Activity和Activity、Fragment之间传递数据的方式
- 使用 Intent 启动 Activity和Activity之间的数据传递
- 两个Activity之间数据的传递
- Android拨打电话和发短信的简单程序
- Activity和Activity之间传递对象
- 实现两个模拟器之间发短信的功能
- 安卓模拟器之间通过程序发短信和通话问题
- Android Studio中两个Activity之间的转换及数据的传递
- 两个Fragment之间的跳转,和数据的传递
- Lex Yacc 使用方法(二)
- echo 命令几个问题
- 好吧,我也可以裸写快排了.
- 何为声明 何为定义
- jbpm4简介
- 两个Activity之间的转换和值传递和发短信程序
- 杨鑫阁:银行业未来会更多的依赖IT系统
- Flex解析XML赋值给DataGrid
- JAVA中的向量(Vector)用法
- linux 中文支持
- java平台的脚本语言可以利用起来了 1
- 思维导图的作业
- REST与SOA
- 几个不错的开源的.net界面控件