mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
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();
|
|
}
|
|
}
|