Skip to content

Commit 2fb4805

Browse files
committed
Simplify back button handling
1 parent d5a6c12 commit 2fb4805

File tree

6 files changed

+1
-36
lines changed

6 files changed

+1
-36
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<activity
3333
android:name=".MainActivity"
3434
android:configChanges="keyboardHidden|orientation"
35-
android:screenOrientation="portrait" android:noHistory="true">
35+
android:screenOrientation="portrait">
3636
<intent-filter>
3737
<action android:name="android.intent.action.MAIN" />
3838

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/Camera2TestActivity.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ protected void onDestroy() {
144144
mOpenCvCameraView.disableView();
145145
}
146146

147-
@Override
148-
public void onBackPressed() {
149-
Intent intent = new Intent(this, MainActivity.class);
150-
startActivity(intent);
151-
}
152-
153147
@Override
154148
public boolean onCreateOptionsMenu(Menu menu) {
155149
// Inflate the menu; this adds items to the action bar if it is present.

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ExpirationDateActivity.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ protected void onDestroy() {
119119
mOpenCvCameraView.disableView();
120120
}
121121

122-
@Override
123-
public void onBackPressed() {
124-
Intent intent = new Intent(this, MainActivity.class);
125-
startActivity(intent);
126-
}
127-
128122
@Override
129123
public boolean onCreateOptionsMenu(Menu menu) {
130124
// Inflate the menu; this adds items to the action bar if it is present.

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageQualityActivity.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,6 @@ protected void onDestroy() {
200200
unloadReference();
201201
}
202202

203-
@Override
204-
public void onBackPressed() {
205-
if(isExternalIntent()) {
206-
super.onBackPressed();
207-
} else {
208-
Intent intent = new Intent(this, MainActivity.class);
209-
startActivity(intent);
210-
}
211-
}
212-
213203
@Override
214204
public boolean onCreateOptionsMenu(Menu menu) {
215205
// Inflate the menu; this adds items to the action bar if it is present.

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/ImageResultActivity.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ private void initViews() {
6363
sendImageButton.setOnClickListener(this);
6464
}
6565

66-
@Override
67-
public void onBackPressed() {
68-
super.onBackPressed();
69-
Intent intent = new Intent(this, MainActivity.class);
70-
startActivity(intent);
71-
}
72-
7366
@Override
7467
public void onClick(View view) {
7568
if (view.getId() == R.id.saveButton) {

app/src/main/java/edu/washington/cs/ubicomplab/rdt_reader/MainActivity.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,4 @@ public void onClickPositiveButton() {
132132
setContentView(R.layout.activity_main);
133133
initViews();
134134
}
135-
136-
@Override
137-
public void onBackPressed() {
138-
super.onBackPressed();
139-
finish();
140-
}
141135
}

0 commit comments

Comments
 (0)