Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify back button handling #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait" android:noHistory="true">
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ protected void onDestroy() {
mOpenCvCameraView.disableView();
}

@Override
public void onBackPressed() {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ protected void onDestroy() {
mOpenCvCameraView.disableView();
}

@Override
public void onBackPressed() {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,6 @@ protected void onDestroy() {
unloadReference();
}

@Override
public void onBackPressed() {
if(isExternalIntent()) {
super.onBackPressed();
} else {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ private void initViews() {
sendImageButton.setOnClickListener(this);
}

@Override
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}

@Override
public void onClick(View view) {
if (view.getId() == R.id.saveButton) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,4 @@ public void onClickPositiveButton() {
setContentView(R.layout.activity_main);
initViews();
}

@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
}