Android creates real-time folders

Source: Internet
Author: User
Package com. king. android. speical; import android. app. activity; import android. content. intent; import android.net. uri; import android. OS. bundle; import android. OS. parcelable; import android. provider. contacts; import android. provider. liveFolders; import com. king. android. r;/*** Description: create a real-time folder by Andy. liu * Time: 12:11:36 **/public class LiveFolderActivity extends Activity {@ Overrideprotected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); if (getIntent (). getAction (). equals (LiveFolders. ACTION_CREATE_LIVE_FOLDER) {Intent intent = new Intent (); // sets the data address intent. setData (Uri. parse ("content: // contacts/live_folders/people"); // sets the event after a click and calls intent after the click. putExtra (LiveFolders. EXTRA_LIVE_FOLDER_BASE_INTENT, new Intent (Intent. ACTION_CALL, Contacts. people. CONTENT_URI); // sets the Real-Time folder name intent. putExtra (LiveFolders. EXTRA_LIVE_FOLDER_NAME, "phone book"); // construct the icon Parcelable icon = Intent. using cuticonresource. fromContext (this, R. drawable. ic_launcher); // Add the shortcut icon intent. putExtra (Intent. EXTRA_SHORTCUT_ICON_RESOURCE, icon); intent. putExtra (LiveFolders. EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders. DISPLAY_MODE_GRID); // normal setResult (RESULT_ OK, intent);} else {// cancel setResult (RESULT_CANCELED);} finish () ;}/ ** <activityandroid: label = "@ string/app_name" android: name = ". speical. widgetActivity "> <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 "/> </intent-filter> </activity> */

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.