Hi, I cannot open an installed app using intent and package name
codice:
Sub OpenApp (applicazione As String)
Dim i As Intent
Dim p As PackageManager
i.Initialize("", "")
i = p.GetApplicationIntent("com.miui.calculator")
If i.IsInitialized Then StartActivity(i)
StartActivity(i)
End Sub
This is log error
log:
main_openapp (java line: 4829)
java.lang.RuntimeException: Object should first be initialized (Intent).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at com.domos.client.main._openapp(main.java:4829)
at com.domos.client.main._btn_camera1_click(main.java:1591)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7548)
at android.view.View.performClickInternal(View.java:7525)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29568)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8244)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Hi Alex, thanks for replay but my problem Is not package name. Calculator Is only an example.
Problem Is that Say me intent not initialized but I don't know how do it
hello everyone, I would like to create an app for elderly people where within this app through icons you can open for example facebook, whatsapp, calendar etc, so I need to understand how to open phone apps from my app even externally by leaving mine app, can anyone tell me how to do it?
www.b4x.com
Also there shouldn't be two StartActivity calls in the code. The one in the check is sufficient.
hello everyone, I would like to create an app for elderly people where within this app through icons you can open for example facebook, whatsapp, calendar etc, so I need to understand how to open phone apps from my app even externally by leaving mine app, can anyone tell me how to do it?
www.b4x.com
Also there shouldn't be two StartActivity calls in the code. The one in the check is sufficient.