0

I want to create an app which will let the user open an mp3 file. I am using FileOpenPicker but get the error while creating an object of FileOpenPicker itself.

FileOpenPicker filePicker = new FileOpenPicker();

This line is throwing an error: An exception of type 'System.NotSupportedException' occurred in PhoneApp1.DLL but was not handled in user code.

Can someone tell me what is the problem here.

The King
  • 833
  • 1
  • 15
  • 41
  • http://stackoverflow.com/questions/15357363/openfilepicker-not-working-on-windows-phone-8-specified-method-is-not-supported – Sajeetharan Jun 03 '14 at 16:21

2 Answers2

1

Windows phone 8 don't support the FileOpenPicker https://wpdev.uservoice.com/forums/110705-dev-platform/suggestions/1897833-video-chooser-task. This feature was added in the windows phone 8.1

AnotherGeek
  • 874
  • 1
  • 6
  • 24
  • How to let the user select an audio file in windows phone 8.1 ? – The King Jun 04 '14 at 04:33
  • They added this feature. Check this out http://www.jayway.com/2014/04/16/windows-phone-8-1-for-developers-contracts/ and there is also this video http://channel9.msdn.com/series/Building-Apps-for-Windows-Phone-8-1/17 – AnotherGeek Jun 04 '14 at 08:13
  • How to make use of this API and target it for windows phone 8.0 ? My phone is still on windows 8.0 and I can see that latest version of whatsapp allows user to select a video file from the video library. How can I achieve the same ? Thanks in advance. – The King Jun 06 '14 at 05:42
  • There is the preview for developers it is an application which allow you to install a preview version of windows phone 8.1 to test your application – AnotherGeek Jun 08 '14 at 21:20
0

From MSDN:

In Windows 8 if you attempt to display the file picker while your app is snapped, the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped, or by unsnapping it before you call the file picker.

Link to Class: http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.pickers.fileopenpicker?cs-save-lang=1&cs-lang=csharp#code-snippet-1

dev_JORD
  • 110
  • 10