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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:00:04+00:00 2026-05-23T07:00:04+00:00

What I want to do is: 1) I’m inside an activity, there are 2

  • 0

What I want to do is:

1) I’m inside an activity, there are 2 buttons. If I click the first one a shortcut is created in my home screen. The shortcut open an html page that has been previously downloaded, so I want it to use the default browser but I don’t want to use internet cause I already have the page.

2)The second button create another shortcut that starts an activity. And i want to pass to the activity some extra arguments (As strings for example)………..

Are those things possible? I found some link and some similar questions like Android: Is there a programming way to create a web shortcut on home screen

They seem to be the answer to my question but someone told me that this code is not gonna work on all devices and that is deprecated and that what i want to do is not possible…….

This technique is not recommended. This is an internal implementation, not part of the Android SDK. It will not work on all home screen implementations. It may not work on all past versions of Android. It may not work in future versions of Android, as Google is not obligated to maintain internal undocumented interfaces. Please do not use this

What means internal implementation? Is that code trustable or not…..help me pls…..

  • 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-23T07:00:04+00:00Added an answer on May 23, 2026 at 7:00 am

    The example code uses undocumented interfaces (permission and intent) to install a shortcut. As “someone” told you, this may not work on all phones, and may break in future Android releases. Don’t do it.

    The correct way is to listen for a shortcut request from the home screen– with an intent filter like so in your manifest:

    <activity android:name=".ShortCutActivity" android:label="@string/shortcut_label">
      <intent-filter>
        <action android:name="android.intent.action.CREATE_SHORTCUT" />
        <category android:name="android.intent.category.DEFAULT" />
      </intent-filter>
    </activity>
    

    Then in the activity that receives the intent, you create an intent for your shortcut and return it as the activity result.

    // create shortcut if requested
    ShortcutIconResource icon =
        Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
    
    Intent intent = new Intent();
    
    Intent launchIntent = new Intent(this,ActivityToLaunch.class);
    
    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, launchIntent);
    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, someNickname());
    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
    
    setResult(RESULT_OK, intent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to ask user to input something but not want to wait forever. There
want to share a link from my application in windows phone 7. Any one
Want to pass 4 values in AJAX parameter.First three are passing properly but the
Want to set up mysql master-slave replications in rails app. Are there plugins/db adapters
Want to forward the following: localhost/bla/index.html -> localhost/index.php?s=bla/index.html localhost/blub.html -> localhost/index.php?s=blub.html localhost/blog.html?site=10 -> localhost/index.php?s=blog.html&site=10
Want to find one and modify that to read, write file on mongoDB gridfs
Want to add some console.writeln's to the first line of every method in my
Want to do it via C#, all inline, no Process.Start()...and free...could be RTF, HTML,
Want to know what the stackoverflow community feels about the various free and non-free
Want my FireFox at work to be in sync with my FireFox at my

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.