K
K
kirawa2019-03-15 10:55:19
Android
kirawa, 2019-03-15 10:55:19

How to update the application?

Good afternoon. When a new version of my application is released on the play market, I display a dialog about this that there is a new version of the program. And when I click on the update button, I run the following code:

private void startActivityForUpgrade() {
        final String appPackageName = getPackageName();
        try {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
        } catch (android.content.ActivityNotFoundException e) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
        }
    }

The problem is that in the play market for this intent, for some reason the update is not available. Available only if the user in the play market in the search bar finds the application himself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-03-15
@zagayevskiy

You have something with testing this feature. Record a video where this is played, I do not believe. Well, in general, IMHO, you do not need to do this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question