mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Add intent to go to LoginActivity
This commit is contained in:
parent
f87eb1e651
commit
658f6da10d
1 changed files with 8 additions and 5 deletions
|
|
@ -32,14 +32,17 @@ public class SignupActivity extends Activity {
|
||||||
private class MyWebViewClient extends WebViewClient {
|
private class MyWebViewClient extends WebViewClient {
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (Uri.parse(url).getHost().equals("www.example.com")) {
|
if (Uri.parse(url).getHost().equals("https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes")) {
|
||||||
// This is my web site, so do not override; let my WebView load the page
|
// This is my web site, so do not override; let my WebView load the page
|
||||||
return false;
|
Log.d("SignupActivity", "Overriding URL");
|
||||||
}
|
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
|
||||||
// Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
Log.d("SignupActivity", "Not overriding URL");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue