Livefolders for Android Study Notes

Source: Internet
Author: User
<? 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 ();
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.