Skip to content

Commit 32255bc

Browse files
committed
Changes added
1 parent a1cabd9 commit 32255bc

12 files changed

+104
-253
lines changed

app/src/main/java/edu/upenn/cis573/jobboard/BottomMenu.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,41 @@ else if (map.containsKey(s))
8989
}
9090
}
9191
public void displayProfile(View view) {
92+
finish();
9293
Intent intent = new Intent(this, ProfileActivity.class);
9394
startActivity(intent);
9495
}
9596

9697
//go to the cart screen
9798
public void displayCart(View view) {
99+
finish();
98100
Intent intent = new Intent(this, CartActivity.class);
99101
startActivity(intent);
100102
}
101103

102104
// go to the job creation screen
103105
public void viewNotifications(View view) {
106+
finish();
104107
Intent intent = new Intent(this, NotificationsPageActivity.class);
105108
startActivity(intent);
106109
}
107110

108111
// go to the MyPostedJobs screen
109112
public void displayMyPostedJobs(View view) {
113+
finish();
110114
Intent intent = new Intent(this, MyPostedJobsActivity.class);
111115
startActivity(intent);
112116
}
113117

114118
//button logic to go to the homepage screen
115119
public void displayHomepage(View view) {
120+
finish();
116121
Intent intent = new Intent(this, HomepageActivity.class);
117122
startActivity(intent);
118123
}
119124

120125
public void viewMessages(View view) {
126+
finish();
121127
Intent intent = new Intent(this, ChatActivity.class);
122128
startActivity(intent);
123129
}

app/src/main/java/edu/upenn/cis573/jobboard/CartActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.os.Build;
1010
import android.os.Bundle;
1111
import android.util.Log;
12+
import android.view.KeyEvent;
1213
import android.view.Menu;
1314
import android.view.MenuItem;
1415
import android.view.View;
@@ -172,6 +173,17 @@ public void logoutUser() {
172173
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
173174
startActivity(intent);
174175
}
176+
/* @Override
177+
public boolean onKeyDown(int keyCode, KeyEvent event)
178+
{
179+
if ((keyCode == KeyEvent.KEYCODE_BACK))
180+
{
181+
finish();
182+
Intent intent = new Intent(this, HomepageActivity.class);
183+
startActivity(intent);
184+
}
185+
return super.onKeyDown(keyCode, event);
186+
}*/
175187

176188

177189
}

app/src/main/java/edu/upenn/cis573/jobboard/CurrentUserActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Activity;
44
import android.content.Intent;
55
import android.os.Bundle;
6+
import android.view.KeyEvent;
67

78
import com.parse.ParseUser;
89

@@ -27,4 +28,15 @@ protected void onCreate(Bundle savedInstanceState) {
2728
startActivity(new Intent(this, SignInActivity.class));
2829
}
2930
}
31+
@Override
32+
public boolean onKeyDown(int keyCode, KeyEvent event)
33+
{
34+
if ((keyCode == KeyEvent.KEYCODE_BACK))
35+
{
36+
finish();
37+
Intent intent = new Intent(this, HomepageActivity.class);
38+
startActivity(intent);
39+
}
40+
return super.onKeyDown(keyCode, event);
41+
}
3042
}

app/src/main/java/edu/upenn/cis573/jobboard/HomepageActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.os.Build;
1111
import android.os.Bundle;
1212
import android.util.Log;
13+
import android.view.KeyEvent;
1314
import android.view.Menu;
1415
import android.view.MenuItem;
1516
import android.view.View;
@@ -234,5 +235,14 @@ public void logoutUser() {
234235
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
235236
startActivity(intent);
236237
}
238+
/* @Override
239+
public boolean onKeyDown(int keyCode, KeyEvent event)
240+
{
241+
if ((keyCode == KeyEvent.KEYCODE_BACK))
242+
{
243+
finish();
244+
}
245+
return super.onKeyDown(keyCode, event);
246+
}*/
237247

238248
}

app/src/main/java/edu/upenn/cis573/jobboard/JobCreationActivity.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.location.LocationManager;
1010
import android.os.Bundle;
1111
import android.util.Log;
12+
import android.view.KeyEvent;
1213
import android.view.Menu;
1314
import android.view.MenuItem;
1415
import android.view.View;
@@ -252,6 +253,16 @@ public void logoutUser() {
252253
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
253254
startActivity(intent);
254255
}
255-
256+
/*@Override
257+
public boolean onKeyDown(int keyCode, KeyEvent event)
258+
{
259+
if ((keyCode == KeyEvent.KEYCODE_BACK))
260+
{
261+
finish();
262+
Intent intent = new Intent(this, HomepageActivity.class);
263+
startActivity(intent);
264+
}
265+
return super.onKeyDown(keyCode, event);
266+
}*/
256267

257268
}

app/src/main/java/edu/upenn/cis573/jobboard/JobDetailsActivity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.content.Intent;
44
import android.os.Bundle;
55
import android.util.Log;
6+
import android.view.KeyEvent;
67
import android.view.Menu;
78
import android.view.MenuItem;
89
import android.view.View;
@@ -398,5 +399,13 @@ public void logoutUser() {
398399
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
399400
startActivity(intent);
400401
}
401-
402+
/*@Override
403+
public boolean onKeyDown(int keyCode, KeyEvent event)
404+
{
405+
if ((keyCode == KeyEvent.KEYCODE_BACK))
406+
{
407+
finish();
408+
}
409+
return super.onKeyDown(keyCode, event);
410+
}*/
402411
}

app/src/main/java/edu/upenn/cis573/jobboard/JobRequestorsActivity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.graphics.Color;
66
import android.os.Bundle;
77
import android.util.Log;
8+
import android.view.KeyEvent;
89
import android.view.Menu;
910
import android.view.MenuItem;
1011
import android.view.View;
@@ -208,4 +209,15 @@ public void logoutUser() {
208209
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
209210
startActivity(intent);
210211
}
212+
/* @Override
213+
public boolean onKeyDown(int keyCode, KeyEvent event)
214+
{
215+
if ((keyCode == KeyEvent.KEYCODE_BACK))
216+
{
217+
finish();
218+
Intent intent = new Intent(this, HomepageActivity.class);
219+
startActivity(intent);
220+
}
221+
return super.onKeyDown(keyCode, event);
222+
}*/
211223
}

app/src/main/java/edu/upenn/cis573/jobboard/MyPostedJobsActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.graphics.Color;
66
import android.os.Bundle;
77
import android.util.Log;
8+
import android.view.KeyEvent;
89
import android.view.Menu;
910
import android.view.MenuItem;
1011
import android.view.View;
@@ -182,8 +183,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
182183
public void logoutUser() {
183184
//Parse method to log out by removing CurrentUser
184185
ParseUser.logOut();
185-
Intent intent = new Intent(MyPostedJobsActivity.this, CurrentUserActivity.class);
186+
Intent intent = new Intent(MyPostedJobsActivity.this, SignInActivity.class);
186187
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
187188
startActivity(intent);
188189
}
190+
189191
}

app/src/main/java/edu/upenn/cis573/jobboard/NotificationsPageActivity.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.os.Build;
1212
import android.os.Bundle;
1313
import android.util.Log;
14+
import android.view.KeyEvent;
1415
import android.view.Menu;
1516
import android.view.MenuItem;
1617
import android.view.View;
@@ -266,5 +267,15 @@ public void displayHomepage(View view) {
266267
Intent intent = new Intent(this, HomepageActivity.class);
267268
startActivity(intent);
268269
}*/
269-
270+
/* @Override
271+
public boolean onKeyDown(int keyCode, KeyEvent event)
272+
{
273+
if ((keyCode == KeyEvent.KEYCODE_BACK))
274+
{
275+
finish();
276+
Intent intent = new Intent(this, HomepageActivity.class);
277+
startActivity(intent);
278+
}
279+
return super.onKeyDown(keyCode, event);
280+
}*/
270281
}

app/src/main/java/edu/upenn/cis573/jobboard/ProfileActivity.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,7 @@ public void displayUserDetails() {
109109

110110
public static void logoutUser() {
111111
//Parse method to log out by removing CurrentUser
112-
try {
113-
ParseUser currentUser = ParseUser.getCurrentUser();
114-
currentUser.logOut();
115-
}
116-
catch (Exception e){
117-
118-
}
112+
ParseUser.logOut();
119113
}
120114

121115
//go to the profile screen

0 commit comments

Comments
 (0)