//1.拨打电话 // 给移动客服10086拨打电话 Uri uri = Uri.parse("tel:10086"); Intent intent = new Intent(Intent.ACTION_DIAL, uri); startActivity(intent); //2.发送短信 // 给 ...
分类:
移动开发 时间:
2019-01-28 17:42:20
阅读次数:
178
从 Android 7.0 开始,Android SDK 中的 StrictMode 策略禁止开发人员在应用外部公开 file:// URI。具体表现为,当我们在应用中使用包含 file:// URI 的 Intent 离开自己的应用时,程序会发生FileUriExposedException 异常 ...
分类:
移动开发 时间:
2019-01-28 10:46:13
阅读次数:
387
1.0 可以利用Intent吧数据传递给上一个活动,新建一个叫“hellotest01”的项目。 新建活动FirstActivity,勾选“Generate Layout File”和“Launcher Activity”。 在活动ThirdActivity被销毁之后会回调上一个活动的onActi... ...
分类:
移动开发 时间:
2019-01-27 16:42:05
阅读次数:
214
一、全局获取Context的技巧 前面我们很多地方都使用到了Context,弹出Toast的时候、启动活动的时候、发送广播的时候、操作数据库的时候、使用通知的时候等等。或许目前来说我们并没有为得不到Context而发愁,因为我们很多地方都是在活动中进行的,而活动本身就是一个Context对象,但是, ...
分类:
移动开发 时间:
2019-01-27 00:21:04
阅读次数:
265
Android使用bindService作为中间人对象开启服务 项目结构如下: MyService: package com.demo.secondservice; import android.app.Service; import android.content.Intent; import a ...
分类:
移动开发 时间:
2019-01-24 23:07:16
阅读次数:
186
首先从写onSaveInstanceState方法,该方法在活动销毁前一定会执行,如下将所需的数据传入到Bundle中 protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); ...
分类:
移动开发 时间:
2019-01-23 01:29:05
阅读次数:
219
在同一个app内,bindservice传入的intent一般通过class生成。例如Intent intent = new Intent(mContext, MyService.class); 但是在跨APP进行bindservice的时候,intent需要通过service的action以及Co ...
分类:
移动开发 时间:
2019-01-22 21:50:57
阅读次数:
162
Short Paper(s) 1. Task-oriented Dialogue System for Automatic Diagnosis. (Cited by 0) Zhongyu Wei, Qianlong Liu, Baolin Peng, Huaixiao Tou, Ting Chen, ...
分类:
其他好文 时间:
2019-01-20 00:55:20
阅读次数:
238
代码期间,把代码过程经常用的内容做个珍藏,下边代码是关于C#的String.Split 分割字符串用法详解的代码,应该对码农们有些用途。 1) public string[] Split(params char[] separator)2) public string[] Split(char[] ...