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

  • Home
  • SEARCH
  • 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 4016740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:46:37+00:00 2026-05-20T09:46:37+00:00

Is it possible to add a button to an app that tries to upgrade

  • 0

Is it possible to add a button to an app that tries to upgrade the app?

I’d love to be able to add a button to the preferences that looks for a newer version of the app. If there is one available, I’d like that button to become active so the user can click it to upgrade.

UPDATE:
Thanks this got me going the right direction. I took a pretty simple approach. Here’s the final code for including a “Check for Updates” button to the preferences.

In the preference XML:

<Preference
android:title="Check for Updates"
android:summary="Version: 1.3"
android:key="versionPref" /> 

In java:

// select button
Preference versionPref = findPreference("versionPref");

// set string
String versionName = getVersionName();
versionPref.setSummary("Version: "+versionName);

// attach to button
versionPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
    public boolean onPreferenceClick(Preference preference) {

    Intent intent = new Intent(Intent.ACTION_VIEW); 
    intent.setData(Uri.parse("market://search?q=pname:com.mycompany.myapp")); 
    startActivity(intent);
    return true;
    }

});

//Get string name

   public String getVersionName() {
       String versionName = "";
       try {
         versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
       } catch (NameNotFoundException e) {
          // Huh? Really?
       }
       return versionName;
    }
  • 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-20T09:46:38+00:00Added an answer on May 20, 2026 at 9:46 am

    Just put up a site somewhere with release number like

    http://example.com/myapp/release
    

    If the releasenum from that page is higher than your current release, enable the upgrade button. You can use the “market://search?q=pname:com.example.myapp” Uri to point the user to download your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to add a button to the right corner of the app
Is it possible to add a Like button inside an app (iframe) to ensure
i add share button to my app , what i wonder if there is
Is it possible to add a custom button in Sharepoint 2010 Ribbon just for
In UITabBar it is possible to add a standard button by clicking on the
Is it possible in Gtk+ to have an add-tab button inline with the tabs
Would it be possible to add a new operator to the String class that
I'm developing an Android language dictionary app. I'm thinking of a Favourites button that
In my published app, I wish to give the user a button that will
We have a air/flex app that we want to add an effect to. Basically

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.