Skip to content
This repository was archived by the owner on Nov 3, 2018. It is now read-only.
This repository was archived by the owner on Nov 3, 2018. It is now read-only.

No update box opens if a new version is available #9

Description

@Landei

Code:

final WVersionManager versionManager = new WVersionManager(this);
     versionManager.setVersionContentUrl("http://[url]/version.txt");
        versionManager.checkVersion();

        versionManager.setOnReceiveListener(new OnReceiveListener() {
            @Override
            public boolean onReceive(int i, String s) {

                try {
                    JSONObject vresponse = new JSONObject(s);
                    s = vresponse.getString("version_code");
                    int v = Integer.parseInt(s);

                    if (versionManager.getCurrentVersionCode() < v){
                        versionManager.setUpdateNowLabel(getResources().getString(R.string.update_now));
                        versionManager.setRemindMeLaterLabel(getResources().getString(R.string.update_later));
                        versionManager.setIgnoreThisVersionLabel(getResources().getString(R.string.never_update));
                        versionManager.setUpdateUrl("market://deatils?id=" + getPackageName());
                        versionManager.setReminderTimer(0);
                        Log.d("","Update" + v);}

                    else{
                        Log.d("","Aktuell Version:" + v + "Aktuell:" + versionManager.getCurrentVersionCode());
                    }

                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return false;
            }
        });

The if is true and it also gives the right value from the .txt file from the server, but no windows apears. :(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions