乙肝病毒表面抗体阴性DNA定量却是阴性,会不会问题更

Android开发入门-不同Activity之间传递数据_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Android开发入门-不同Activity之间传递数据
上传于|0|0|暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢Android笔记——不同apk之间传递参数与数据_android开发_ThinkSAAS
Android笔记——不同apk之间传递参数与数据
Android笔记——不同apk之间传递参数与数据
内容来源: 网络
android编程的时候,有时候需要在不同的apk之间传递参数或数据,下面是一个简单的例子:
APK(1)的程序代码:
IntentSend.java:
package com.
import android.app.A
import android.content.I
import android.os.B
import android.view.V
import android.widget.B
public class IntentSend extends Activity {
Channel channel = new Channel();
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
szws = (Button)findViewById(R.id.szws);
szws.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v) {
Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putString("channel", channel.channels[0]);
intent.setClassName("com.bget","com.bget.BinderGET");
intent.putExtras(bundle);
startActivity(intent);
Channel.java:
package com.
public class Channel {
String channels[] = {
"深圳卫视",
"深圳电视剧",
"深圳都市"
APK(2)的程序代码:
IntentGet.java:
package com.
import android.app.A
import android.os.B
import android.widget.TextV
public class IntentGet extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
info =(TextView)findViewById();
Bundle bundle = new Bundle();
bundle = this.getIntent().getExtras();
info.setText("现在播放的是:"+ bundle.getString("channel"));
程序中,主要是调用了Intent和Bundle的方法,Intent程序之间的跳转,Bundle程序之间数据的传递。
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信怎么打开另一个app并传递一些参数过去 - Android当前位置:& &&&怎么打开另一个app并传递一些参数过去怎么打开另一个app并传递一些参数过去&&网友分享于:&&浏览:537次怎样打开另一个app并传递一些参数过去?怎样打开另一个app并传递一些参数过去?
Intent&LaunchIntent&=&getPackageManager().getLaunchIntentForPackage("com.example.xeednfc");
Bundle&bundle&=&new&Bundle();
bundle.putString("user","1");
LaunchIntent.putExtras(bundle);
startActivity(LaunchIntent);
protected&void&onCreate(Bundle&savedInstanceState)&
super.onCreate(savedInstanceState);
Bundle&bunde&=&getIntent().getExtras();
怎么bundle&一直是空的。接收不到
if(bunde!=null)
&&bundle.getString("user");
------解决方案--------------------contentprivider------解决方案--------------------contentprivider------解决方案--------------------ContentProvider&你可以网上搜一下&&这是Android的四大组件之一------解决方案--------------------你这个方法是启动的主activity就是配置main的,这个你控制不了。其他activity就自己在配置文件写个action,然后用这个action打开。打开的不是主界面了------解决方案--------------------为什么不用Intent&i=new&Intent(A.this,B.class)来传递参数呢?------解决方案--------------------还是给你写代码
在第一个app里
Intent&intent&=&new&Intent("com.ox.lyq.ABCD");
intent.putExtra("abcd",&"ABCD");
startActivity(Intent.createChooser(intent,&"ABCD"));
在第二个app的AndroidManifest.xml里
&&activity&android:name="BActivity"&&
&&&&&&&&&&&&&intent-filter&
&&&&&&&&&&&&&&&&&action&android:name="com.ox.lyq.ABCD"&/&
&&&&&&&&&&&&&&&&&category&android:name="android.intent.category.DEFAULT"&/&
&&&&&&&&&&&&&/intent-filter&
&&/activity&
&&category&android:name="android.intent.category.DEFAULT"&/&
在这个activity里
textView&=&(TextView)&findViewById(R.id.textView1);
Intent&intent&=&getIntent();
if&(intent&!=&null)&{
&&&&String&str&=&intent.getStringExtra("abcd");
&&&&textView.setText(str);
这绝对是2个app
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有本帖子已过去太久远了,不再提供回复功能。

我要回帖

更多关于 乙肝表面抗原定量阴性 的文章

 

随机推荐