Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9228169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:15:26+00:00 2026-06-18T05:15:26+00:00

I know I can create a widget that that can be placed on the

  • 0

I know I can create a widget that that can be placed on the homescreen, but is there a possibility that when the user installs the app, only my standard launcher icon will start a certain activity. But when the user chooses so (by clicking a button for example in my app) another icon will be created on the home screen of the device that directly links to another activity? So by clicking that icon on the home screen another activity in my package will open?

Does anybody has a snippet if possible?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:15:27+00:00Added an answer on June 18, 2026 at 5:15 am

    Thanks to this blog: http://viralpatel.net/blogs/android-install-uninstall-shortcut-example/

    In the Manifest add the needed permissions:

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

    add to your activity in the manifest where the shortcut is referring to:

       android:exported="true"
    

    Then use the following methods to install/uninstall the shortcut:

     private void addShortcut() {
            //Adding shortcut for MainActivity 
            //on Home screen
            Intent shortcutIntent = new Intent(getApplicationContext(),
                    MainActivity.class);
    
            shortcutIntent.setAction(Intent.ACTION_MAIN);
    
            Intent addIntent = new Intent();
            addIntent
                    .putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
            addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "HelloWorldShortcut");
            addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
                    Intent.ShortcutIconResource.fromContext(getApplicationContext(),
                            R.drawable.ic_launcher));
    
            addIntent
                    .setAction("com.android.launcher.action.INSTALL_SHORTCUT");
            getApplicationContext().sendBroadcast(addIntent);
        }
    
    
    private void removeShortcut() {
    
            //Deleting shortcut for MainActivity 
            //on Home screen
            Intent shortcutIntent = new Intent(getApplicationContext(),
                    MainActivity.class);
            shortcutIntent.setAction(Intent.ACTION_MAIN);
    
            Intent addIntent = new Intent();
            addIntent
                    .putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
            addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "HelloWorldShortcut");
    
            addIntent
                    .setAction("com.android.launcher.action.UNINSTALL_SHORTCUT");
            getApplicationContext().sendBroadcast(addIntent);
        }
    

    To add an activity to the shortcuts manu simply add this intent filter to your activity in your manifest:

    <intent-filter>
        <action android:name="android.intent.action.CREATE_SHORTCUT" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how I can Dynamically create an installation package that installs files
I know I can create a List<T> from IEnumerable<T> by doing myEnumerableCollection.ToList() , but
I'm using python 3.1.1. I know that I can create byte objects using the
I know that horizontal partitioning...you can create many tables. How can you do this
I need to create a window that the user can tap. I need to
I have an app with a widget. I know that Android 4.0 or later
I know I can create a plot with line and dots using the type
Does anyone know how I can create a Completely transparent image or given am
I would like to know how can I create a regexp to match the
I want to know if PHPExcel can: Create Excel spreadsheets with embeded image. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.