package com.ljq.activity;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.LiveFolders;
public class TestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(getIntent().getAction().equals(LiveFolders.ACTION_CREATE_LIVE_FOLDER)){
Intent intent = new Intent();
intent.setData(Uri.parse("content://contacts/live_folders/people"));
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT,
new Intent(Intent.ACTION_VIEW,ContactsContract.Contacts.CONTENT_URI));
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, "电话本"); //快捷方式的标题
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
Intent.ShortcutIconResource.fromContext(this, R.drawable.png1));//快捷方式的图标
intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);//显示模型
setResult(RESULT_OK, intent);
}
else{
setResult(RESULT_CANCELED);
}
finish();
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ljq.activity" android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".TestActivity"
android:label="@string/app_name">
<!-- 注意此处 -->
<intent-filter>
<action android:name="android.intent.action.CREATE_LIVE_FOLDER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有