Skip to content

Commit

Permalink
fix: html file cannot be opened from sub directories
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Sep 15, 2023
1 parent 737cdc0 commit a923d46
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package android.code.editor.ui.activities;

import android.code.editor.R;
import android.code.editor.common.utils.FileUtils;
import android.code.editor.utils.Setting;
import android.code.editor.utils.SimpleHttpServer;
import android.code.editor.utils.Utils;
Expand Down Expand Up @@ -134,7 +133,9 @@ && getIntent().getStringExtra("type").equals("file")) {
new SimpleHttpServer(
8080,
getIntent().getStringExtra("root"),
FileUtils.getLatSegmentOfFilePath(getIntent().getStringExtra("data")));
getIntent()
.getStringExtra("data")
.substring(getIntent().getStringExtra("root").length()));
hoster.startServer();
initialUrl = hoster.getLocalIpAddress();
webview.loadUrl(initialUrl);
Expand Down

0 comments on commit a923d46

Please sign in to comment.