public Uri getPhotoUri() {
Uri person = ContentUris.withAppendedId(
ContactsContract.Contacts.CONTENT_URI, Long.parseLong(getId()));
Uri photo = Uri.withAppendedPath(person,
ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
Cursor cur = this.ctx
.getContentResolver()
.query(
ContactsContract.Data.CONTENT_URI,
null,
ContactsContract.Data.CONTACT_ID
+ "="
+ this.getId()
+ " AND "
+ ContactsContract.Data.MIMETYPE
+ "='"
+ ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE
+ "'", null, null);
if (cur != null) {
if (!cur.moveToFirst()) {
return null; // no photo
}
} else {
return null; // error in cursor process
}
return photo;
}
分享到:
相关推荐
前端项目-URI.js,uri.js是一个用于处理URL的JavaScript库。
Win10系统如何使用URI.docx
小儿呼吸道特点急性上呼吸道感染AURI.ppt
script type =" text/javascript " src =" bower_components/uri.js/src/URI.js " > </ script > 在angular.js和URI.js之后包括angular-uri < script type =" text/javascript " src =" bower_...
set of generic URI related routines.
uri.c URI 组件编码器/解码器安装$ clib install littlstar/uri.c用法# include < uri> # include < stdio># include < string># include " uri.h "intmain ( void ) { char *enc = NULL ; char *dec = NULL ; enc =...
It s little try to implement a URI class fpr Visaul C++. So everybody who is interestet my first try look at this files.
关于URI的说明,大家可以侃侃,Web上可用的每种资源 - HTML文档、图像、视频片段、程序等 - 由一个通过通用资源标志符(Universal Resource Identifier, 简称"URI")进行定位。
常用的Uri大全,对于Android开发人员来说很有用。
URI.js重要提示:您可能不再需要URI.js ! 现代浏览器提供和接口。 注意: npm软件包名称已更改为urijs 在查看如下代码时,我总是想把自己的脑袋开枪: var url = "http://example.org/foo?bar=baz" ;var separator ...
one of my solved problem
org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable ...
数据库共享的例子,由 Provider提供
我就废话不多说了,大家还是直接看代码吧~ //Uri.parse(file://+result.getImage... //方法一:通过uri把图片转化为bitmap的方法 Bitmap bitmap= BitmapFactory.decodeFile(path); int height= bitmap.get
Android Intent调用 Uri的方法总结 //调用浏览器 Uri uri = Uri.parse(); Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it); //显示某个坐标在地图上 Uri uri = Uri.parse(geo:38.899533,-...
本文实例讲述了CI框架URI.php中_fetch_uri_string()函数用法。分享给大家供大家参考,具体如下: APPPATH/config/config.php中对于url 格式的拟定。 $config['uri_protocol'] = 'AUTO'; 这个配置项目定义了你使用...
Uri :: Js :: Rails Rails的 安装 将此行添加到您的应用程序的Gemfile中: gem 'uri-js-rails', :group => :assets 然后执行: $ bundle 或将其自己安装为: $ gem install uri-js-rails 用法 添加到您的...
const uri = try Uri. parse ( "https://ziglang.org/documentation/master/#toc-Introduction" ); assert (mem. eql ( u8 , uri.scheme, "https" )); assert (mem. eql ( u8 , uri.host, "ziglang.org" )); assert...
Dart中用于处理的实用程序,主要用于解析和生成URI。 UriPattern UriPattern是用于匹配和解析URI的类的接口,就像是用于String的接口一样。 它定义了方法bool matches(Uri uri)和UriMatch match(Uri uri) 。 ...