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 7683637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:50:24+00:00 2026-05-31T18:50:24+00:00

I want the user to be able to see my application in the menu

  • 0

I want the user to be able to see my application in the menu only until he configurates it after that i want to remove the shortcut also i would like to put a shortcut on the users desktop.I am pretty new to java

It’s there a way I can acheive this ?

  • 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-05-31T18:50:25+00:00Added an answer on May 31, 2026 at 6:50 pm

    I don’t know of a way that you could have it appear in the app drawer but remove it later.

    To create a shortcut on the home screen you can use the following method.

    PLEASE NOTE – I believe The intent that is being broadcast here, and the permission that you must request in your manifest are not a part of the public APIs. This method will not work on every home screen implementation. This method will potentially stop working at any time (and may already not work on newer versions of android, I only tested on Nexus S, but it does seem to work on that device).

    You have been warned

        public boolean setShortCut(Context context, String appName)
    {
        System.out.println("in the shortcutapp on create method ");
        boolean flag =false ;
        int app_id=-1;
        PackageManager p = context.getPackageManager();
        Intent i = new Intent(Intent.ACTION_MAIN);
        i.addCategory(Intent.CATEGORY_LAUNCHER);
        List<ResolveInfo> res =p.queryIntentActivities( i,0);
        System.out.println("the res size is: "+res.size());
    
        for(int k=0;k<res.size();k++)
        {
            System.out.println("the application name is: "+res.get(k).activityInfo.loadLabel(p));
            if(res.get(k).activityInfo.loadLabel(p).toString().equals(appName)){
                flag = true;
                app_id = k;
                break;
            }
        }
    
        if(flag){
            ActivityInfo ai = res.get(app_id).activityInfo;
    
            Intent shortcutIntent = new Intent();
            shortcutIntent.setClassName(ai.packageName, ai.name);
            shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            Intent intent = new Intent();
            intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
    
            intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "SIZETESTDYNAMIC");
    
            intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.icon));
            //intent.addCategory(Intent.CATEGORY_DEFAULT);
            intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
            context.sendBroadcast(intent);
            System.out.println("in the shortcutapp on create method completed");
        }
        else
            System.out.println("appllicaton not found");
        return true;
    }
    

    and you’ll have to add this permission to your manifest:

    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want the user to be able to see the source code of the
I want the user to be able to select an option, which would change
I have a MovieClip that I want the user to be able to drag
I have a dictionary of strings that i want the user to be able
I have a console application in C#, and I want that the user won't
When a user logs into my application, there are some menu items that I
I want the user to be able to make some preferences like colors, prefered
I want the user to be able to enter a name for a file
I want my user to be able to hit the submit button and have
I want the user to be able to choose from a dropdown Combobox listing

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.