Android video player selection interface pop-up mechanism, android Mechanism
1. file manager and videos have different video recognition mechanisms.
A) file manager identifies the file based on the suffix. 3gp, mp4, and avi are considered as three different video formats respectively. Therefore, the video player selection page is displayed.
B) In videos, video recognition is set based on the file mimetype. 3gp is a simplified mp4 file and can be considered as a file of the same type. In the android design, the 3gp and mp4 files use the same parser. The mimetype of the two files is the same, both of which are video/mp4 files. Because android default uses the same mimetype for 3gp and mp4, When you select always for playing 3gp, the video player selection page does not pop up when you play mp4 again.
2. in earlier versions, the company once supported the distinction between 3gp and mp4. 3gp has a custom mimetype, but this change will make some third-party applications unable to identify and use 3gp files, for example, instagram, which is popular abroad, cannot share the 3gp file recorded by camera. Finally, considering applicability, the 3gp method is returned to the android default method.
3. We recommend that you maintain the Android default design. The same is true for reference machines. No matter how you modify the behavior, there will be side effect.
A) Solution1: Modify the behavior of the Videos app to check the suffix instead of mimetype. Because the suffix is not reliable, for example,. 3gp is not necessarily true. 3gp, so there are also problems.
B) Solution2: Modify the underlying scan behavior. As mentioned above, Android default may be different for behaviors, which may cause problems in other apps.
Hello, I made an android video player and asked how to enable my own player by default when the video is played? Or you are prompted to select a player.
You can go to Baidu video to find Dreamweaver teaching. There are a lot that you can watch slowly. You can also go to the teaching CD and download it to learn it. Use it directly.
Android pop-up model window
The custom adapter inherits from the BaseAdapter and adds the Handler parameter to the constructor. This Handler is used to update the listView and pop-up windows for the UI thread.
Set a listener for the listView button, Click Event Callback handler, and send a position to handler.
When dialog is played, a callback parameter is added to the constructor, such as the dialogConfirmListener class. There is an onConfirm (parameter) interface that transmits a dialogConfirmListener to the difir. when you click OK, the parameter is passed, refresh the list data.