Fuse Community

I hope that use Activity.getApplicationContext()

나는 "activity"를 사용하기 위해서 "com.fuse.Activity.getRootACtivty().getApplicationContext()"를 사용 했으나 제대로 동작하지 않는 것을 발견하고 이곳에 문의를 넣엇다. 누군가 나를 도와줫으면 좋겟다.

Can you share some code for us to debug?

Thank you for your attention, I solved the above problem, but in the face of other problems, I’m asking for help, sorry for not sharing the whole source.

[Foreign(Language.Java)]
static Java.Object GetWaveSdk()
@{
String API_KEY = “abcd”;
DecoderHandler waveHandler = new DecoderHandler() {
@Override
protected void initializeStart() {

            }

            @Override
            protected void initializeSuccess(InitializeResult initializeResult) {

            }

            @Override
            protected void initializeFail(InitializeResult initializeResult) {

            }

            @Override
            protected void scanStop() {

            }

            @Override
            protected void scanVerifying() {

            }

            @Override
            protected void scanFinished(ScanResult scanResult) {

            }

            @Override
            protected void scanError(ScanResult scanResult) {

            }
            
        };

        WaveSdk waveSdk = new WaveSdk(waveHandler, API_KEY, com.fuse.Activity.getRootActivity().getApplicationContext());
        Log.d("WaveSdk", "waveSdk Created.");

        return waveSdk;
	@}

log
Uno.Exception: Unexpected Uno.Exception —> Uno.Exception: java.lang.RuntimeException: Can’t create handler inside thread that has not called Looper.prepare()
at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr,[string])
at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr)
at Android.Base.Wrappers.JavaObjectHelper.JObjectToJWrapper(Android.Base.Primitives.ujobject,bool)
at Mobidoo.Sound.MobidooSoundAPI.CheckKey()
at Mobidoo.Sound.MobidooSoundJavaScript.CheckKey(Fuse.Scripting.Context,object[])
at Fuse.Scripting.NativeFunction.NativeFunctionClosure.Callback(Fuse.Scripting.Context,object[])
at Fuse.Scripting.V8.Marshaller.CallbackWrapper.Call(Fuse.Scripting.V8.Simple.JSValue[],Fuse.Scripting.V8.Simple.JSValue&)
at Fuse.Scripting.V8.V8SimpleExtensions.Call(Fuse.Scripting.V8.Simple.JSFunction,Fuse.Scripting.V8.Simple.JSContext,Fuse.Scripting.V8.Simple.JSObject,Fuse.Scripting.V8.Simple.JSValue[],Fuse.Scripting.V8.AutoReleasePool,Uno.Action<Fuse.Scripting.V8.Simple.JSScriptException>)
at Fuse.Scripting.V8.Function.Call(Fuse.Scripting.Context,object[])
at Fuse.Scripting.FunctionMirror.CallClosure.Call(Fuse.Scripting.Context)
at Fuse.Scripting.JavaScript.ThreadWorker.RunOnce(Fuse.Scripting.JavaScript.JSContext)
at Fuse.Scripting.JavaScript.ThreadWorker.RunInner(Fuse.Scripting.JavaScript.JSContext)
at Fuse.Scripting.JavaScript.ThreadWorker.Run()
at Uno.Threading.Thread.ThreadMain(Uno.Threading.Thread)
— End of inner exception stack trace —
at Fuse.Scripting.V8.Context.ThrowPendingExceptions()
at Fuse.Scripting.V8.Function.Call(Fuse.Scripting.Context,object[])
at Fuse.Scripting.FunctionMirror.CallClosure.Call(Fuse.Scripting.Context)
at Fuse.Scripting.JavaScript.ThreadWorker.RunOnce(Fuse.Scripting.JavaScript.JSContext)
at Fuse.Scripting.JavaScript.ThreadWorker.RunInner(Fuse.Scripting.JavaScript.JSContext)
at Fuse.Scripting.JavaScript.ThreadWorker.Run()
at Uno.Threading.Thread.ThreadMain(Uno.Threading.Thread)