Added upgrade dialog
This commit is contained in:
parent
a233314e89
commit
d4820a7816
|
@ -32,8 +32,9 @@
|
||||||
<string name="yesMsg">Sí</string>
|
<string name="yesMsg">Sí</string>
|
||||||
<string name="noMsg">No</string>
|
<string name="noMsg">No</string>
|
||||||
<string name="firstRunMsg">Antes de usar la aplicación por primera vez debe introducir el nombre de usuario y la contraseña de acceso a SWAD en la pantalla de configuración.\n\nPuede acceder a la pantalla de configuración desde el menú de la aplicación en cualquier momento.\n\n¿Desea abrir ahora la pantalla de configuración?</string>
|
<string name="firstRunMsg">Antes de usar la aplicación por primera vez debe introducir el nombre de usuario y la contraseña de acceso a SWAD en la pantalla de configuración.\n\nPuede acceder a la pantalla de configuración desde el menú de la aplicación en cualquier momento.\n\n¿Desea abrir ahora la pantalla de configuración?</string>
|
||||||
<string name="initialDialogTitle">IMPORTANTE</string>
|
<string name="initialDialogTitle">IMPORTANTE</string><string name="upgradeMsg">Debido a cambios en la base de datos todos los datos de las notificaciones han sido borrados.\n\nDisculpe las molestias.</string>
|
||||||
<string name="errorServerResponseMsg">Error en respuesta del servidor</string><string name="errorConnectionMsg">Error durante la conexión con el servidor</string><string name="errorTimeoutMsg">Tiempo de espera agotado intentando conectar con el servidor</string>
|
<string name="errorServerResponseMsg">Error en respuesta del servidor</string><string name="errorConnectionMsg">Error durante la conexión con el servidor</string><string name="errorTimeoutMsg">Tiempo de espera agotado intentando conectar con el servidor</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -34,8 +34,8 @@
|
||||||
<string name="messages">Messages</string><string name="evaluation">Evaluation</string><string name="fromMsg">From</string>
|
<string name="messages">Messages</string><string name="evaluation">Evaluation</string><string name="fromMsg">From</string>
|
||||||
<string name="dateMsg">Date</string>
|
<string name="dateMsg">Date</string>
|
||||||
<string name="yesMsg">Yes</string>
|
<string name="yesMsg">Yes</string>
|
||||||
<string name="noMsg">No</string><string name="firstRunMsg">Before using the application for the first time you must enter the user name and password for SWAD at the setup screen.\n\nYou can access to the setup screen from the application menu anytime.\n\nDo you want to open the configuration screen now?</string>
|
<string name="noMsg">No</string>
|
||||||
<string name="initialDialogTitle">IMPORTANT</string><string name="errorServerResponseMsg">Error in server response</string>
|
<string name="initialDialogTitle">IMPORTANT</string><string name="firstRunMsg">Before using the application for the first time you must enter the user name and password for SWAD at the setup screen.\n\nYou can access to the setup screen from the application menu anytime.\n\nDo you want to open the configuration screen now?</string><string name="upgradeMsg">Due to changes in the database all notifications data have been deleted.\n\nSorry.</string><string name="errorServerResponseMsg">Error in server response</string>
|
||||||
<string name="errorConnectionMsg">Error while connecting to server</string>
|
<string name="errorConnectionMsg">Error while connecting to server</string>
|
||||||
<string name="errorTimeoutMsg">Timeout trying to connect to the server</string>
|
<string name="errorTimeoutMsg">Timeout trying to connect to the server</string>
|
||||||
|
|
||||||
|
|
|
@ -108,9 +108,9 @@ public class SWADMain extends ExpandableListActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows initial dialog on first run.
|
* Shows configuration dialog on first run.
|
||||||
*/
|
*/
|
||||||
public void showInitialDialog() {
|
public void showConfigurationDialog() {
|
||||||
new AlertDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.setTitle(R.string.initialDialogTitle)
|
.setTitle(R.string.initialDialogTitle)
|
||||||
.setMessage(R.string.firstRunMsg)
|
.setMessage(R.string.firstRunMsg)
|
||||||
|
@ -126,6 +126,18 @@ public class SWADMain extends ExpandableListActivity {
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows initial dialog after application upgrade.
|
||||||
|
*/
|
||||||
|
public void showInitialDialog() {
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.initialDialogTitle)
|
||||||
|
.setMessage(R.string.upgradeMsg)
|
||||||
|
.setCancelable(false)
|
||||||
|
.setNeutralButton(R.string.close_dialog, null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see android.app.Activity#onCreateOptionsMenu()
|
* @see android.app.Activity#onCreateOptionsMenu()
|
||||||
|
@ -292,8 +304,12 @@ public class SWADMain extends ExpandableListActivity {
|
||||||
lastVersion = prefs.getLastVersion();
|
lastVersion = prefs.getLastVersion();
|
||||||
currentVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
currentVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
|
||||||
if(lastVersion == 0) {
|
if(lastVersion == 0) {
|
||||||
showInitialDialog();
|
showConfigurationDialog();
|
||||||
prefs.setLastVersion(currentVersion);
|
prefs.setLastVersion(currentVersion);
|
||||||
|
} else if(currentVersion > lastVersion) {
|
||||||
|
dbHelper.emptyTable(Global.DB_TABLE_NOTIFICATIONS);
|
||||||
|
prefs.setLastVersion(currentVersion);
|
||||||
|
showInitialDialog();
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.e(ex.getClass().getSimpleName(), ex.getMessage());
|
Log.e(ex.getClass().getSimpleName(), ex.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user