The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
PhotoChooserTask still always return cancel on my device RRS feed

  • Question

  • Hi, I still have problem which I posted in thread http://social.msdn.microsoft.com/Forums/en/windowsphone7series/thread/e5909853-0d81-4497-bf5c-96a2ff71e38f . I was continueing my development work by using Emulator and it is almost done. So I have to resolved this issue before I upload my app to the marketplace.
    I read the reference link given by Jonathan it is really helpful. I even did not realize my application has the same issue. If I use PhotochooserTask twice, the second time will failed because of the issue mentioned in this link.
    My issue is that if application deployed to device. After PhotoChooserTask compelte, e.TaskResult in PhotoChooserTaskCompleted(object sender, PhotoResult e) is always "Cancel". I don't have this issue with Emulator.
    My device is "asus galaxy 6". I do power cycling my device, however the issue is not resolved. Following is my code snippet, could anyone help?

    public partial class MainPage : PhoneApplicationPage
    {
    PhotoChooserTask m_photoChooserTask;
    // Constructor
    public MainPage()
    {
    InitializeComponent();
    m_photoChooserTask = new PhotoChooserTask();
    m_photoChooserTask.Completed += PhotoChooserTaskCompleted;
    }
    private void UploadIconButton_Click(object sender, EventArgs e)
    {
    m_photoChooserTask.Show();
    }
    void PhotoChooserTaskCompleted(object sender, PhotoResult e)
    {
    if (e.TaskResult == TaskResult.OK)
    {
    PhotoTaskHelper.ChosenPhotoName = e.OriginalFileName;
    PhotoTaskHelper.ChosenPhotoStream = e.ChosenPhoto;
    NavigationService.Navigated += new NavigatedEventHandler(PhotoChooserNavigated);
    }
    else
    {
    albumCtrl.Title = e.TaskResult.ToString();
    }
    }
    private void PhotoChooserNavigated(object sender, NavigationEventArgs e)
    {
    NavigationService.Navigated -= new NavigatedEventHandler(PhotoChooserNavigated);
    NavigationService.Navigate(new Uri("/PhotoUpload.xaml", UriKind.Relative));
    }
    }
    Thanks,
    Wednesday, October 20, 2010 6:41 PM

Answers

  • Hi Guoguo,

    Try disconnecting the device from the PC to run this part of your code.

    The camera (and some other functions) doesn't work when attached to Zune.

    Also, for some earlier prototype devices (e.g. LG) it's necessary to power cycle sometimes after this to get it working again.


    ________________________________________________________________
    MSDN CTP, Beta, RTM Reference Forum (from Pre-launch)

    Wednesday, October 20, 2010 10:44 PM

All replies

  • Hi Guoguo,

    Try disconnecting the device from the PC to run this part of your code.

    The camera (and some other functions) doesn't work when attached to Zune.

    Also, for some earlier prototype devices (e.g. LG) it's necessary to power cycle sometimes after this to get it working again.


    ________________________________________________________________
    MSDN CTP, Beta, RTM Reference Forum (from Pre-launch)

    Wednesday, October 20, 2010 10:44 PM
  • Hi Guoguo,

    Try disconnecting the device from the PC to run this part of your code.

    The camera (and some other functions) doesn't work when attached to Zune.

    Also, for some earlier prototype devices (e.g. LG) it's necessary to power cycle sometimes after this to get it working again.


    ________________________________________________________________
    MSDN CTP, Beta, RTM Reference Forum (from Pre-launch)

    Thanks, now it´s working.
    Tuesday, May 31, 2011 8:29 AM
  • is there any way to detect when the phone is attached to Zune so that we can display a message to the user saying that the camera wont work etc?
    Saturday, January 14, 2012 10:38 AM