The following is an example of the SDK:
First, you must add<Action Android: Name = "android. Intent. Action. create_live_folder"/>
Then the analysis is as follows:
Public class mylivefolder extends activity {
Public static final URI content_uri = URI. parse ("content: // my. APP/live ");
Protected void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
// Get intent
Final intent = getintent (); // obtain the action set in androidmanifest
Final string action = intent. getaction ();
// Determine
If (livefolders. action_create_live_folder.equals (Action )){
Setresult (result_ OK, createlivefolder (this, content_uri, "My livefolder ",
R. drawable. ic_launcher_contacts_phones ));
} Else {
Setresult (result_canceled );
}
Finish ();
}
Private Static intent createlivefolder (context, Uri, string name,
Int icon ){
Final intent = new intent ();
// Set the data address
Intent. setdata (URI); // you can specify the Real-Time folder name.
Intent. putextra (livefolders. extra_live_folder_name, name); // sets the image of the real-time folder.
Intent. putextra (livefolders. extra_live_folder_icon,
Intent. shortcuticonresource. fromcontext (context, icon); // sets the display mode for real-time folders. One is the list mode, and the other is the nine cells mode.
Intent. putextra (livefolders. extra_live_folder_display_mode, livefolders. display_mode_list );
Return intent;
}
}