How to get a list of installed android applications and pick one to run

后端 未结 19 1831
误落风尘
误落风尘 2020-11-21 06:26

I asked a similar question to this earlier this week but I\'m still not understanding how to get a list of all installed applications and then pick one to run.

I\'v

19条回答
  •  执念已碎
    2020-11-21 07:12

    Since Android 11 (API level 30), most user-installed apps are not visible by default. You must either statically declare which apps and/or intent filters you are going to get info about in your manifest like this:

    
        
            
            
            
    
            
            
                
                
            
        
        
        ...
    
    

    Or require the QUERY_ALL_PACKAGES permission.

    After doing the above, the other answers here still apply.

    Learn more here:

    • The migration documentation
    • The dedicated documentation page (has more information)
    • The official blog post

提交回复
热议问题