<? XML version = "1.0" encoding = "UTF-8"?>
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "King. Demo"
Android: versioncode = "1"
Android: versionname = "1.0" type = "codeph" text = "/codeph">
<Application Android: icon = "@ drawable/icon" Android: Label = "@ string/app_name">
<Activity Android: Name = ". mainactivity"
Android: Label = "@ string/app_name">
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. launcher"/>
<Action Android: Name = "android. Intent. Action. create_live_folder"/>
<Category Android: Name = "android. Intent. Category. Default"/>
</Intent-filter>
</Activity>
</Application>
</Manifest>
Package king. Demo;
Import Android. R. anim;
Import Android. App. activity;
Import Android. content. intent;
Import android.net. Uri;
Import Android. OS. Bundle;
Import Android. provider. contactscontract. contacts;
Import Android. provider. Contacts. People;
Import Android. provider. livefolders;
Public class mainactivity extends activity {
/** Called when the activity is first created .*/
@ Override
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Setcontentview (R. layout. Main );
// Determine whether to create a real-time folder
If (getintent (). getaction (). Equals (livefolders. action_create_live_folder )){
Intent intent = new intent ();
// Set the data address
Intent. setdata (URI. parse ("content: // contacts/people/"); // The URI of the contact
// Set the event after clicking. Click a contact here to call
Intent. putextra (livefolders. extra_live_folder_base_intent,
New intent (intent. action_call, Android. provider. Contacts. People. content_uri ));
// Set the Real-Time folder name
Intent. putextra (livefolders. extra_live_folder_name, "phone book ");
// Set the icon of the implementation folder
Intent. putextra (livefolders. extra_live_folder_icon, intent. Reset cuticonresource. fromcontext (this, R. drawable. Icon ));
// Set the display mode to list
Intent. putextra (livefolders. extra_live_folder_display_mode, livefolders. display_mode_list );
// Complete
Setresult (result_ OK, intent );
}
Else
{
Setresult (result_canceled );
}
Finish ();
}
}