Skip to content

Commit

Permalink
Lua.java: now Lua works fine in background
Browse files Browse the repository at this point in the history
without ANR
  • Loading branch information
Ildar Mulyukov committed Jun 12, 2020
1 parent 553c967 commit 248ec4b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/src/main/java/com/github/ildar/AndroidLuaSDK/Lua.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ public int onStartCommand (Intent intent, int flags, int startId) {
if (L == null) {
main_instance = this;
L = newState(true);
setGlobal("service",this);
setGlobal("service", this);
setGlobal("intent", intent);
}
log("Lua service started");
log("Starting `init`");
require("init");
log("`init` started");
new Thread() { public void run() {
log("Starting `init`");
require("init");
log("`init` started");
} }.start();

return START_STICKY;
}
Expand Down

0 comments on commit 248ec4b

Please sign in to comment.