mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
use getIntent from luajit-launcher
This commit is contained in:
committed by
Frans de Jonge
parent
2009ffa12f
commit
2093bf6d94
@@ -10,25 +10,7 @@ ffi.cdef[[
|
||||
]]
|
||||
|
||||
-- check uri of the intent that starts this application
|
||||
local file = A.jni:context(A.app.activity.vm, function(JNI)
|
||||
local uri = JNI:callObjectMethod(
|
||||
JNI:callObjectMethod(
|
||||
A.app.activity.clazz,
|
||||
"getIntent",
|
||||
"()Landroid/content/Intent;"
|
||||
),
|
||||
"getData",
|
||||
"()Landroid/net/Uri;"
|
||||
)
|
||||
if uri ~= nil then
|
||||
local path = JNI:callObjectMethod(
|
||||
uri,
|
||||
"getPath",
|
||||
"()Ljava/lang/String;"
|
||||
)
|
||||
return JNI:to_string(path)
|
||||
end
|
||||
end)
|
||||
local file = A.getIntent()
|
||||
|
||||
if file ~= nil then
|
||||
A.LOGI("intent file path " .. file)
|
||||
|
||||
Reference in New Issue
Block a user