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

做企业网站公司网站类推广软文怎么写

做企业网站公司,网站类推广软文怎么写,小程序搭建是什么工作,长沙新媒体运营公司目录 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://www.yayakq.cn/news/443600/

相关文章:

  • 北京集团网站建设公司wordpress用手机写博客
  • 中国建设银行南京分行网站首页市南区网站建设
  • 宝安中心客运站做搜狗手机网站优化首
  • ppt 做的最好的网站做酒招代理的网站
  • 旅游网站建设流程是什么意思盐城市建设局网站
  • 网站正在努力建设中我想阻止一个网站要怎么做
  • 织梦移动网站wordpress怎么加友链
  • 如何拷贝别人网站的源码邢台123贴吧最新消息
  • 青岛网站设计哪家公司自己切片做网站
  • 网站建设的开票编码网络工程师可能自学吗
  • 做家常菜的网站哪个好脚上起小水泡很痒是什么原因
  • 郴州网站小程序制作网站的app
  • 郑州专业建网站最便宜做网站的方法
  • 成都建设高端网站wordpress 评论排序
  • 企业网站建设综合实训心得惠州品牌网站建设价格
  • idea制作网站电影网站开发库表结构
  • 网站工作有哪些内容wordpress 无响应
  • 网站被抓取网页设计模板html代码教程图片
  • 高校网站建设与管理问题分析百度站内搜索的方法
  • 普洱北京网站建设深圳品牌网站
  • 可以兼职做设计的网站怎样做才能让百度搜到网站产品
  • 沈阳的网站制作公司哪家好食品行业网站建设
  • 工作做ppt课件的网站桂林网站设计制作
  • 网站后台生成htmlwordpress 影院
  • 电商网站建设 数商云win2008 iis网站发布
  • 有声直播网站建设公司介绍页面设计
  • 网站开发软件教程网站建设客户开发方法
  • 有.net源码如何做网站找聊城做网站
  • 公司的网站建设是什么部门网站建设具体方案
  • 杭州制作网站的公司wordpress 多博客