Android Things启动意图 [英] Android Things intent for boot
问题描述
在将应用程序部署到
使用最新版本的AndroidThings,将不再显示IntentChooser,但是由于已选择已打开一个已安装的应用程序,而其他应用程序却没有打开,该问题仍然存在.
When I reboot after deploying an application to Android Things the application doesn't start.
Is there a specific intent to start an application on boot?
If your Android Things device has multiple applications installed that all have this intent filter in the manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
( < DP8 used to need IOT_LAUNCHER
that has been deprecated)
Then your application will not start by default, instead the Intent Chooser dialog will be shown and the system will wait for user input to select which app to run. (This happens wether or not you have an actual display plugged in. If you don't have a display it might appear as tho the device is just hanging.)
I wrote a script here: https://gist.github.com/blundell/7c0c3bb17898b28fe8122b0dc230af50 that will uninstall all applications that have the above Intent Filter so that you can start again and only have 1 application installed - therefore this application will start on boot.
With the latest version of AndroidThings the IntentChooser will not be shown anymore, however the problem can persist as one of the apps installed is selected to open and the others do not.
这篇关于Android Things启动意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!