Android and android Official Website

Source: Internet
Author: User

Android and android Official Website

Code

/***** Return the Intent added to the desktop shortcut: ** 1. specify action = "com. android. launcher. INSTALL_SHORTCUT "** 2. define it as Intent. the Intent settings of EXTRA_SHORTCUT_INENT are the same as those during installation (required) ** 3. add permission: com. android. launcher. permission. INSTALL_SHORTCUT */public Intent getshortcuttow.topintent (Context context) {Intent intent = new Intent (); intent. setClass (context, context. getClass ();/* the following two sentences are used to delete the desktop shortcut */intent when you detach an application. setAction ("android. intent. action. MAIN "); intent. addCategory ("android. intent. category. LAUNCHER "); Intent export cut = new Intent (" com. android. launcher. action. INSTALL_SHORTCUT "); // reconstruction of shortcut is not allowed. putExtra ("duplicate", false); // set the name // shortcut. putExtra (Intent. EXTRA_SHORTCUT_NAME, context. getString (R. string. app_name); shortcut cut. putExtra (Intent. EXTRA_SHORTCUT_NAME, "11111"); // sets the shortcut cut icon. putExtra (Intent. EXTRA_SHORTCUT_ICON_RESOURCE, Intent. using cuticonresource. fromContext (context, R. drawable. youtube); // sets intent and shortcut Association program shortcut. putExtra (Intent. EXTRA_SHORTCUT_INTENT, intent); return shortcut ;}

Permission

<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>

Call

public void click1(View v) {        Intent intent = this.getShortcutToDesktopIntent(MainActivity.this);        sendBroadcast(intent);    }

I am the dividing line of tiantiao

 


What is android

Android means a robot. android phones use android phones. Google developed android phones and android phones do not know what the android phones mean.

What is android

Android means a robot. android phones use android phones. Google developed android phones and android phones do not know what the android phones mean.

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.