minor changes in PCB regarding notification behaviour

parent ddce7b6a
...@@ -94,7 +94,10 @@ public class NetService implements Runnable { ...@@ -94,7 +94,10 @@ public class NetService implements Runnable {
} }
public boolean online() {return updated;} 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 * 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 { ...@@ -69,6 +69,14 @@ public final class PCBcontext {
getNetService().notifyStatus(); 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) * @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, ...@@ -737,8 +737,10 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
count_deletelong++; count_deletelong++;
if (count_deletelong >= 3) if (count_deletelong >= 3) {
PictogramActivity.this.finish();
PCBcontext.getNetService().restart_app(); PCBcontext.getNetService().restart_app();
}
return false; 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