package com.gpr.gabinetedigital; import android.app.AlertDialog; import android.app.Application; import android.content.DialogInterface; import android.os.Bundle; import android.widget.Toast; public class UpdateActivity extends Application implements UpdateHelper.onUpdateCheckListener { @Override public void onCreate() { super.onCreate(); UpdateHelper.with(this) .onUpdateCheck(this) .check(); } @Override public void onUpdateCheckListener(String urlApp) { AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle("New Version Available") .setMessage("Please update to new version to continue use") .setPositiveButton("UPDATE", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(UpdateActivity.this, ""+urlApp,Toast.LENGTH_SHORT).show(); } }).setNegativeButton("CANCEL", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }).create(); alertDialog.show(); } }