mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Modify onBackPressed()
This commit is contained in:
parent
3c895e3473
commit
0fe7998488
1 changed files with 6 additions and 15 deletions
|
|
@ -17,16 +17,14 @@ import fr.free.nrw.commons.R;
|
||||||
|
|
||||||
public class SignupActivity extends Activity {
|
public class SignupActivity extends Activity {
|
||||||
|
|
||||||
private boolean otherPage;
|
private WebView webView;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Log.d("SignupActivity", "Signup Activity started");
|
Log.d("SignupActivity", "Signup Activity started");
|
||||||
otherPage = false;
|
|
||||||
|
|
||||||
|
webView = new WebView(this);
|
||||||
WebView webView = new WebView(this);
|
|
||||||
setContentView(webView);
|
setContentView(webView);
|
||||||
|
|
||||||
webView.setWebViewClient(new MyWebViewClient());
|
webView.setWebViewClient(new MyWebViewClient());
|
||||||
|
|
@ -59,19 +57,12 @@ public class SignupActivity extends Activity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if (otherPage == true) {
|
if (webView.canGoBack()) {
|
||||||
//If we are in any page except the main signup page, back button should take us back to signup page
|
webView.goBack();
|
||||||
Intent intent = new Intent(this, SignupActivity.class);
|
} else {
|
||||||
startActivity(intent);
|
super.onBackPressed();
|
||||||
}
|
|
||||||
else {
|
|
||||||
//If we are in signup page, back button should take us back to LoginActivity
|
|
||||||
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue