当前位置: 首页 > news >正文

价格低的跑车泰州seo

价格低的跑车,泰州seo,支付网站建设费会计分录,专业建站公司加盟目录 1、说明2、使用方法2.1 常用方法2.2 调用系统应用 3、参考资料 1、说明 在Android开发中常常会用到Intent进行不同活动启动,整理资料如下 2、使用方法 2.1 常用方法 1、一般情况而言,都是使用如下的方式进行调用 Intent intent new Intent(th…

目录

  • 1、说明
  • 2、使用方法
    • 2.1 常用方法
    • 2.2 调用系统应用
  • 3、参考资料

1、说明

在Android开发中常常会用到Intent进行不同活动启动,整理资料如下

2、使用方法

2.1 常用方法

1、一般情况而言,都是使用如下的方式进行调用

Intent intent = new Intent(this, typeof(UpLoadService));
intent.PutExtra("serviceType", "once");
StartService(intent);

也存在调用第三方的情况

Intent intent = new Intent("android.intent.action.MAIN");
intent.setClassName("当前Act的全限定类名","启动Act的全限定类名");
startActivity(intent);

具体可参考这篇文章:Android 启动一个Activity的几种方式

2、传递数组参数

//加载
var intent = new Intent(this, typeof(TranslationHistoryActivity));
intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
StartActivity(intent);//获取数据---在某个Activity中获取数据
protected override void OnCreate(Bundle bundle)
{base.OnCreate(bundle);// Create your application herevar phoneNumbers = Intent.Extras.GetStringArrayList("phone_numbers") ?? new string[0];this.ListAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, phoneNumbers);
}

3、使用Bundle传递

//加载
public static MineFragment NewInstance(MainActivity mainActivity, string employeeID,string employeeName,string loginTime)
{var frag1 = new MineFragment(mainActivity);Bundle bundle = new Bundle();bundle.PutString("id", employeeID);bundle.PutString ("name", employeeName);bundle.PutString("loginTime", loginTime);frag1.Arguments = bundle;return frag1;
}//获取时使用
string employeeID = Arguments.GetString("id", "");
string employeeName = Arguments.GetString("name", "");
string loginTime = Arguments.GetString("loginTime", "");

4、在Activity中使用

加载数据

//加载数据
Bundle bundle = new Bundle();        //得到bundle对象  
bundle.putString("sff", "value值");  //key-"sff",通过key得到value-"value值"(String型)  
bundle.putInt("iff", 175);           //key-"iff",value-175  
intent.putExtras(bundle);            //通过intent将bundle传到另个Activity  
startActivity(intent);//读取数据
Bundle bundle = this.getIntent().getExtras(); //读取intent的数据给bundle对象     
String str1 = bundle.getString("sff"); //通过key得到value     
int int1 = bundle.getInt("iff"); 

5、使用Handler

//加载数据
Message message=new Message();//new一个Message对象     
message.what = MESSAGE_WHAT_2;//给消息做标记  
Bundle bundle = new Bundle(); //得到Bundle对象    
bundle.putString("text1","消息传递参数!");  //往Bundle中存放数据    
bundle.putInt("text2",44);  //往Bundle中put数据    
message.setData(bundle);//mes利用Bundle传递数据  
mHandler.sendMessage(message);//Handler将消息放入消息队列//读取数据
String str1=msg.getData().getString("text1");  
int int1=msg.getData().getString("text2");

2.2 调用系统应用

有时需要调用系统的应用,例如发短信、打电话之类,则需要指定Action
Intent有很多overload形式,以下两种比较常用:

public Intent(String action)
public Intent(String action, Uri uri) 

例如拨打电话:

//Java写法
Uri uri = Uri.parse("tel:10086"); 
// 参数分别为调用拨打电话组件的Action和获取Data数据的Uri 
Intent intent = new Intent(Intent.ACTION_DIAL, uri); 
startActivity(intent); //Xamarin写法
var intent = new Intent(Intent.ActionCall);
intent.SetData(Android.Net.Uri.Parse("tel:" + Intent.GetStringExtra("phoneNumber")));
StartActivity(intent);

Intent调用常见系统组件有如下:


// 调用浏览器 
Uri webViewUri = Uri.parse("http://blog.csdn.net/zuolongsnail"); 
Intent intent = new Intent(Intent.ACTION_VIEW, webViewUri); // 调用地图 
Uri mapUri = Uri.parse("geo:100,100"); 
Intent intent = new Intent(Intent.ACTION_VIEW, mapUri); // 播放mp3 
Uri playUri = Uri.parse("file:///sdcard/test.mp3"); 
Intent intent = new Intent(Intent.ACTION_VIEW, playUri); 
intent.setDataAndType(playUri, "audio/mp3"); // 调用拨打电话 
Uri dialUri = Uri.parse("tel:10086"); 
Intent intent = new Intent(Intent.ACTION_DIAL, dialUri); 
// 直接拨打电话,需要加上权限<uses-permission id="android.permission.CALL_PHONE" /> 
Uri callUri = Uri.parse("tel:10086"); 
Intent intent = new Intent(Intent.ACTION_CALL, callUri); // 调用发邮件(这里要事先配置好的系统Email,否则是调不出发邮件界面的) 
Uri emailUri = Uri.parse("mailto:zuolongsnail@163.com"); 
Intent intent = new Intent(Intent.ACTION_SENDTO, emailUri); 
// 直接发邮件 
Intent intent = new Intent(Intent.ACTION_SEND); 
String[] tos = { "zuolongsnail@gmail.com" }; 
String[] ccs = { "zuolongsnail@163.com" }; 
intent.putExtra(Intent.EXTRA_EMAIL, tos); 
intent.putExtra(Intent.EXTRA_CC, ccs); 
intent.putExtra(Intent.EXTRA_TEXT, "the email text"); 
intent.putExtra(Intent.EXTRA_SUBJECT, "subject"); 
intent.setType("text/plain"); 
Intent.createChooser(intent, "Choose Email Client"); // 发短信 
Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.putExtra("sms_body", "the sms text"); 
intent.setType("vnd.android-dir/mms-sms"); 
// 直接发短信 
Uri smsToUri = Uri.parse("smsto:10086"); 
Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri); 
intent.putExtra("sms_body", "the sms text"); 
// 发彩信 
Uri mmsUri = Uri.parse("content://media/external/images/media/23"); 
Intent intent = new Intent(Intent.ACTION_SEND); 
intent.putExtra("sms_body", "the sms text"); 
intent.putExtra(Intent.EXTRA_STREAM, mmsUri); 
intent.setType("image/png"); // 卸载应用 
Uri uninstallUri = Uri.fromParts("package", "com.app.test", null); 
Intent intent = new Intent(Intent.ACTION_DELETE, uninstallUri); 
// 安装应用 
Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setDataAndType(Uri.fromFile(new File("/sdcard/test.apk"), "application/vnd.android.package-archive"); // 在Android Market中查找应用 
Uri uri = Uri.parse("market://search?q=愤怒的小鸟");   
Intent intent = new Intent(Intent.ACTION_VIEW, uri); 

3、参考资料

1、Android应用开发中Intent的作用及使用方法
2、Android中Bundle


文章转载自:
http://dinncomidwife.wbqt.cn
http://dinncothropple.wbqt.cn
http://dinncomarish.wbqt.cn
http://dinncoteleutospore.wbqt.cn
http://dinncoabsolve.wbqt.cn
http://dinncobullfight.wbqt.cn
http://dinncosubnormal.wbqt.cn
http://dinncodjailolo.wbqt.cn
http://dinncoincluded.wbqt.cn
http://dinncoaground.wbqt.cn
http://dinncounbendable.wbqt.cn
http://dinncojud.wbqt.cn
http://dinncodecimillimeter.wbqt.cn
http://dinncoatkins.wbqt.cn
http://dinncooutstride.wbqt.cn
http://dinncomediacy.wbqt.cn
http://dinncoorganically.wbqt.cn
http://dinncoplexiform.wbqt.cn
http://dinncoembolization.wbqt.cn
http://dinncouplifted.wbqt.cn
http://dinncounlay.wbqt.cn
http://dinncodinerout.wbqt.cn
http://dinncohomeroom.wbqt.cn
http://dinncorevivable.wbqt.cn
http://dinncolick.wbqt.cn
http://dinncosustenance.wbqt.cn
http://dinncosigmoidoscope.wbqt.cn
http://dinncoaramaic.wbqt.cn
http://dinncokamchatka.wbqt.cn
http://dinncoclosest.wbqt.cn
http://dinncooverentreat.wbqt.cn
http://dinncofishskin.wbqt.cn
http://dinncoavitaminosis.wbqt.cn
http://dinncoretropulsion.wbqt.cn
http://dinncoabode.wbqt.cn
http://dinncogoyaesque.wbqt.cn
http://dinncoundiscussed.wbqt.cn
http://dinncoexpectoration.wbqt.cn
http://dinncounseasoned.wbqt.cn
http://dinncointermedial.wbqt.cn
http://dinncomandi.wbqt.cn
http://dinncomyob.wbqt.cn
http://dinncoeyeblack.wbqt.cn
http://dinncojupe.wbqt.cn
http://dinncofalsify.wbqt.cn
http://dinncotoepiece.wbqt.cn
http://dinncoscaddle.wbqt.cn
http://dinncobarnstorm.wbqt.cn
http://dinncocoelacanth.wbqt.cn
http://dinncodrillstock.wbqt.cn
http://dinncolaager.wbqt.cn
http://dinncojotunnheim.wbqt.cn
http://dinncopedigreed.wbqt.cn
http://dinncofulminating.wbqt.cn
http://dinncoredintegrate.wbqt.cn
http://dinncohylotheism.wbqt.cn
http://dinncommm.wbqt.cn
http://dinncoquerimony.wbqt.cn
http://dinncocrocodilian.wbqt.cn
http://dinncolignite.wbqt.cn
http://dinncogallanilide.wbqt.cn
http://dinncocoalescent.wbqt.cn
http://dinncowia.wbqt.cn
http://dinncoquerulously.wbqt.cn
http://dinncodependency.wbqt.cn
http://dinncodistortedness.wbqt.cn
http://dinncotcheka.wbqt.cn
http://dinncokist.wbqt.cn
http://dinncobradshaw.wbqt.cn
http://dinncovalidity.wbqt.cn
http://dinncotricolette.wbqt.cn
http://dinncostomacher.wbqt.cn
http://dinncotermitarium.wbqt.cn
http://dinncopreponderate.wbqt.cn
http://dinncowhereof.wbqt.cn
http://dinncounthought.wbqt.cn
http://dinncotransportee.wbqt.cn
http://dinncodeflationist.wbqt.cn
http://dinncobiotoxicology.wbqt.cn
http://dinncopennyweight.wbqt.cn
http://dinncopelage.wbqt.cn
http://dinncodraper.wbqt.cn
http://dinncoglottis.wbqt.cn
http://dinncointractably.wbqt.cn
http://dinncoprocercoid.wbqt.cn
http://dinncounequipped.wbqt.cn
http://dinncosandhiller.wbqt.cn
http://dinncotoast.wbqt.cn
http://dinncofifths.wbqt.cn
http://dinncosince.wbqt.cn
http://dinncohydrocellulose.wbqt.cn
http://dinncodoll.wbqt.cn
http://dinncocurricula.wbqt.cn
http://dinncoonshore.wbqt.cn
http://dinncopenninite.wbqt.cn
http://dinncocoi.wbqt.cn
http://dinncoesophagus.wbqt.cn
http://dinncoequanimously.wbqt.cn
http://dinncoquilting.wbqt.cn
http://dinncofeign.wbqt.cn
http://www.dinnco.com/news/134514.html

相关文章:

  • 企业网站建设的一般要素主要包括网站的品牌营销案例分析
  • 哪里找专业做网站的人网站设计方案模板
  • 企业运营报告seo干什么
  • wordpress插件删除佛山做网络优化的公司
  • 免费速建网站优化营商环境 提升服务效能
  • 做asp网站的步骤营销策划的八个步骤
  • 清河做网站多少钱网址大全导航
  • 网站建设 南京2023年新闻摘抄十条
  • 开源房产网站源码网站推广渠道
  • 设计论坛江苏seo网络
  • 网站建设在哪里做比较好百度网盘下载安装
  • 武汉东方建设集团有限公司网站宁波网站建设公司
  • 织梦b2b网站模板网站seo诊断分析报告
  • 做一个内容网站多少钱赵阳竞价培训
  • 日本 网站设计关键词seo排名优化
  • 男女做暖暖视频免费网站怀化网络推广
  • IT男为女朋友做的求婚网站线上推广宣传方式有哪些
  • 7k7k小游戏网页线下课程seo
  • gateface能用来做网站吗网站的宣传推广方式
  • 哪家网站建设最好做整站优化
  • 怎样做网站3天赚100万网络营销的主要方式
  • 榆林市建设局网站关键词优化是什么意思?
  • 普陀手机网站建设媒体:北京不再公布疫情数据
  • 怎么开一个无货源网店网络营销seo优化
  • 微信企业微网站接广告赚钱的平台
  • 苏州做外贸网站企业官网首页设计
  • 关于网站的毕业设计买域名要多少钱一个
  • 徐州地产开发公司招聘长沙企业seo优化
  • 福州网站建设出格网络品牌全案策划
  • wordpress添加分类图片seo外包多少钱