简体   繁体   中英

Intent to specific application without knowing its package name

My main purpose is to open Calendar app installed on Client (User's phone) when user click on a button.

The problem is there are so many various Android devices out there, each with different package name for stock Calendar app. Second problem is what if user has 3rd party Calendar application such as Jorte.

So what cross my mind is solution using Intent to filter specific application, in this case Calendar app. So user can choose which Calendar application to choose from. I saw an example here , but it needs us to know the package name.

Based on the first problem I mentioned above (various package name). How to do it without need to knowing the Calendar package name?

The answer is right according to @M_K

Finally I use PackageManager, loop and filter its package name having a word "Calendar", store it on the List. Then loop out the List to let user choose which Calendar App to run from the list.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM