Skip to content

Commit

Permalink
Remove hardcoded wiki.termux.com url from HelpActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
agnostic-apollo committed Jun 6, 2021
1 parent 7225e2b commit 7ef9255
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/com/termux/app/activities/HelpActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import android.widget.ProgressBar;
import android.widget.RelativeLayout;

import com.termux.shared.termux.TermuxConstants;

/** Basic embedded browser for viewing help pages. */
public final class HelpActivity extends Activity {

Expand Down Expand Up @@ -39,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("https://wiki.termux.com")) {
if (url.equals(TermuxConstants.TERMUX_WIKI_URL) || url.startsWith(TermuxConstants.TERMUX_WIKI_URL + "/")) {
// Inline help.
setContentView(progressLayout);
return false;
Expand All @@ -60,7 +62,7 @@ public void onPageFinished(WebView view, String url) {
setContentView(mWebView);
}
});
mWebView.loadUrl("https://wiki.termux.com/wiki/Main_Page");
mWebView.loadUrl(TermuxConstants.TERMUX_WIKI_URL);
}

@Override
Expand Down

0 comments on commit 7ef9255

Please sign in to comment.