minor changes in PCB regarding notification behaviour

parent ddce7b6a
......@@ -94,7 +94,10 @@ public class NetService implements Runnable {
}
public boolean online() {return updated;}
public void restart_app() {this.device.restart_app();}
public void restart_app() {
PCBcontext.unset_user();
this.device.restart_app();
}
/**
* ping to the server by using a restapi call. If ok, the call will return the empty set
......
......@@ -69,6 +69,14 @@ public final class PCBcontext {
getNetService().notifyStatus();
}
public static void unset_user() {
pcbdb = null;
if (room!=null) room.exit();
room = null;
vocabulary = null;
getNetService().notifyStatus();
}
/**
*
* @return true if a given user has been logged into the system (the login window was successfully filled)
......
......@@ -737,8 +737,10 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
public boolean onLongClick(View v) {
count_deletelong++;
if (count_deletelong >= 3)
PCBcontext.getNetService().restart_app();
if (count_deletelong >= 3) {
PictogramActivity.this.finish();
PCBcontext.getNetService().restart_app();
}
return false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment