I 'inherited' a messaging app that allows users to not only send messages, but also send pictures, videos, and file as attachments. These attachments, when received, are saved to the users SD card.
From within the app, if the users click on the received attachment, that attachment should be opened appropriately in a corresponding application. For example, pictures are opened in the gallery, pdfs are opened in a PDF-veiwer, and videos should be opened and played in the users default video player.
My problem is that currently, when a user receives a video file of the .ts format, my app does not recognize it as a video file, but instead as a text file. This prevents the user from being able to click on the attachment from within my messaging app to view the video, a core feature of my app.
How could I enact this functionality? Thank you, and please let me know if there's any code I should include from my app that would help.
I'm assuming you pass it to the 'corresponding application' by intent. You can use
intent.setType("video/")
to ensure that it opens in a video app.