If we can't parse the port file, try again. Maybe we are catching it between create and write?
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4494 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
0e5d6056e4
commit
39dbfdec82
@ -111,10 +111,10 @@ public class MainActivity extends Activity {
|
||||
activity.runOnUiThread(() -> {
|
||||
web_view.loadUrl(base_url);
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!key.reset()) {
|
||||
Log.w("tildefriends", "watcher is no longer valid");
|
||||
break;
|
||||
@ -242,6 +242,8 @@ public class MainActivity extends Activity {
|
||||
private int read_port(String path) {
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
|
||||
return Integer.parseInt(reader.readLine());
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.io.FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.io.IOException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user