开发者

Android: Is it possible to prevent a specific activity from handling an intent?

开发者 https://www.devze.com 2023-04-11 16:11 出处:网络
My android application starts an intent consisting of a video file.One thing I\'m trying to do is prevent the build in video player from handling this intent.Instead I only want third party players to

My android application starts an intent consisting of a video file. One thing I'm trying to do is prevent the build in video player from handling this intent. Instead I only want third party players to be chosen to play this file. Anyone know if there is any way to create an implicit intent and prevent certain activities/applicat开发者_如何学编程ions from being selected to open the intent?

Thanks, Harry


Pass custom object in Intent for eg a string that notifies the activity that it is being called by your App since other apps are not passing that custom object you can have check in onCreate while filtering Intent and thus check for that custom object if its present then go else finish the activity

0

精彩评论

暂无评论...
验证码 换一张
取 消