Skip to content
Snippets Groups Projects
Commit 7aa74fd0 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

Bugfix mission editor in Android OS

parent a817d316
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ public class MissionActivity extends Activity{
if(isEdit){
//Update register with new name and serialized
if(editMission()){
((StavorApplication)getApplication()).loader.reset();
//((StavorApplication)getApplication()).loader.reset();
finish();
}else{
Toast.makeText(getApplicationContext(), getString(R.string.mission_error_edit), Toast.LENGTH_LONG).show();
......@@ -113,7 +113,7 @@ public class MissionActivity extends Activity{
}else{
//Create new register in db
if(addMission()){
((StavorApplication)getApplication()).loader.reset();
//((StavorApplication)getApplication()).loader.reset();
finish();
}else{
Toast.makeText(getApplicationContext(), getString(R.string.mission_error_create), Toast.LENGTH_LONG).show();
......@@ -219,17 +219,13 @@ public class MissionActivity extends Activity{
e.printStackTrace();
}
// Insert the new row, returning the primary key value of the new row
long newRowId;
newRowId = ((StavorApplication)getApplication()).db.update(
// Edit the row
((StavorApplication)getApplication()).loader.update(
MissionEntry.TABLE_NAME,
values,
"_id "+"="+mission.id,
null);
if(newRowId==-1)
return false;
else
return true;
return true;
}
private boolean addMission(){
......@@ -243,16 +239,12 @@ public class MissionActivity extends Activity{
e.printStackTrace();
}
// Insert the new row, returning the primary key value of the new row
long newRowId;
newRowId = ((StavorApplication)getApplication()).db.insert(
// Insert the new row
((StavorApplication)getApplication()).loader.insert(
MissionEntry.TABLE_NAME,
null,
values);
if(newRowId==-1)
return false;
else
return true;
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment