mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Add comments
This commit is contained in:
parent
6e47d7866d
commit
0ba6b9c09a
1 changed files with 5 additions and 3 deletions
|
|
@ -37,14 +37,14 @@ public class SignupActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (url.equals("https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes")) {
|
if (url.equals("https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes")) {
|
||||||
// Signup success, so load LoginActivity again
|
//Signup success, so load LoginActivity again
|
||||||
Log.d("SignupActivity", "Overriding URL" + url);
|
Log.d("SignupActivity", "Overriding URL" + url);
|
||||||
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
||||||
intent.putExtra("Redirected", true);
|
intent.putExtra("Redirected", true);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
//If user clicks any other links in the webview
|
||||||
Log.d("SignupActivity", "Not overriding URL, URL is: " + url);
|
Log.d("SignupActivity", "Not overriding URL, URL is: " + url);
|
||||||
otherPage = true;
|
otherPage = true;
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -55,10 +55,12 @@ public class SignupActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
if (otherPage == true) {
|
if (otherPage == true) {
|
||||||
|
//If we are in any page except the main signup page, back button should take us back to signup page
|
||||||
Intent intent = new Intent(this, SignupActivity.class);
|
Intent intent = new Intent(this, SignupActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
//If we are in signup page, back button should take us back to LoginActivity
|
||||||
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
||||||
intent.putExtra("Redirected", true);
|
intent.putExtra("Redirected", true);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue