Android Things intent for boot

后端 未结 6 1896
半阙折子戏
半阙折子戏 2021-02-08 15:48

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?

6条回答
  •  囚心锁ツ
    2021-02-08 16:18

    If your Android Things device has multiple applications installed that all have this intent filter in the manifest:

    
        
        
        
    
    

    ( < 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.

提交回复
热议问题