android - how to simulate a button click on an app icon/shortcut -


i wonder how possible simulate button click launch app through shortcut? have seen automation apps such automagic (perhaps tasker) this. using accessibilityservices? if yes, how call such shortcut -do use "performglobalaction()"?

edit: after emulate/simulate click on button or shortcut apps such tasker can do. instance, google assistant cannot opened programatically (see how start google assistant programatically?) due permission denail. however, can opened clicking on shortcut on screen opened according following instructions: https://www.ytechb.com/how-to-get-google-assistant-on-any-android-lollipop-device-without-root/

with tasker can add action opens shortcut. wondering how tasker programatically.

you can launch android app using intent. launch intent application can use

context.getpackagemanager().getlaunchintentforpackage(string packagename); 

if not null, app installed on device , can launch it. if want list of other apps on device can use

context.getpackagemanager().queryintentactivities(intent intent, int flags); 

you can find more information of these looking @ packagemanager docs


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -