Logout on activity destroy

This commit is contained in:
Jerry Wu 2018-07-11 00:30:25 +08:00
parent 8f2305303c
commit b1531788db
2 changed files with 11 additions and 2 deletions

View File

@ -300,6 +300,14 @@ public class MainActivity extends AppCompatActivity {
} }
@Override
protected void onDestroy() {
new Thread(new Runnable() {
@Override
public void run() {
Network.requestPost(Network.LOGOUT_URI, new HashMap<String, String>());
}
}).start();
super.onDestroy();
}
} }

View File

@ -28,6 +28,7 @@ import java.util.Set;
public class Network { public class Network {
public static final String LOGIN_URI = "http://study.ck.tp.edu.tw/login_chk.asp"; public static final String LOGIN_URI = "http://study.ck.tp.edu.tw/login_chk.asp";
public static final String LOGOUT_URI = "http://study.ck.tp.edu.tw/logout.asp";
public static String uploadFile(String sourceFileUri, InputStream in, String uploadFileName) { public static String uploadFile(String sourceFileUri, InputStream in, String uploadFileName) {