Phone restarts when Camera is recording in flyout and back button is pressed.

I am developing an app in which I have some tabs which are shown on every page. In one of screens I need to click a picture and I can't hide the tabs. So I created a flyout and put a captureElement and buttons to capture image in it. But when the camera
is recording and hardware back button is pressed then the phone freezes and restarts. I could not find the reason. Can anybody help? 
My Code is
<Grid Grid.Row="1" x:Name="ContentRoot">
            <TextBlock Text="Capture Image" FontSize="26" Tapped="TextBlock_Tapped" VerticalAlignment="Center" HorizontalAlignment="Center">
                <FlyoutBase.AttachedFlyout>
                    <Flyout Placement="Full">
                        <StackPanel>
                            <CaptureElement Name="captureElement" Stretch="UniformToFill" HorizontalAlignment="Stretch"/>
                            <Button Content="Capture" Tapped="Button_Tapped"/>
                            <Button Content="Save" Tapped="Button_Tapped_1"/>
                        </StackPanel>
                    </Flyout>
                </FlyoutBase.AttachedFlyout>
            </TextBlock>
        </Grid>
private void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
            captureElement.Width = 620;
            captureElement.Height = 800;
            var element = sender as FrameworkElement;
            if (element != null)
                FlyoutBase.ShowAttachedFlyout(element);
        MediaCapture _capture;
        async private void Button_Tapped(object sender, TappedRoutedEventArgs e)
            try
                _capture = new MediaCapture();
                await _capture.InitializeAsync();
            catch { } 
            captureElement.Source = _capture;
            _capture.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
            _capture.SetRecordRotation(VideoRotation.Clockwise90Degrees);
            await _capture.StartPreviewAsync();
        async private void Button_Tapped_1(object sender, TappedRoutedEventArgs e)
            StorageFile sfa = await KnownFolders.CameraRoll.CreateFileAsync("Demo.jpg", CreationCollisionOption.GenerateUniqueName);
            StorageFile sf = await ApplicationData.Current.LocalFolder.CreateFileAsync("Demo.jpg", CreationCollisionOption.GenerateUniqueName);
            await _capture.CapturePhotoToStorageFileAsync(ImageEncodingProperties.CreateJpeg(), sfa);
            await _capture.StopPreviewAsync();
            _capture.Dispose();

It sounds like you're running into some kind of driver bug. Are you specifically handling the back button press?  If not, can you listen for that and see if the problem still reproduces?
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.

Similar Messages

  • I use iphone 3GS, after upgared to ios5, my phone restart when i took picture with   button and while playing music .. what happened?

    I use iphone 3GS, after upgraded to ios5, my phone restart when i took picture with   button and while playing music .. what happened?

    Basic troubleshooting steps in the following order.
    1. Reset. Press and hold both Power and Home Buttons together till Apple Logo appears.
    2. Restore to a backup.
    3. Backup, Restore in iTunes and setup as new.

  • My Nokia 3110 classic Phone restarts when I try to...

    My Nokia 3110 classic phone restarts when I try to send data to another by connecting to that particular device via Bluetooth.
    Solved!
    Go to Solution.

    shravan12 wrote:
    As Because my phone tries to hung and restarts when I connect to any other Bluetooth devices.

  • Upgraded to 6.0 bundle 3049 and now my phone restarts when I try to send group text

    I upgraded to 6.0 bundle 3049 & now my phone restarts when I select "Send" for a group text. Any suggestions on how to correct this, please? Thanks!!

    Settings > Messages > Send and Received > Uncheck any number/email that does not belong to the device
    Note: The little blue (>) will give you an option to remove the number/email from the device
    Note: Check this setting on any device(s) using the same Apple ID

  • Can not delete text messages without phone freezing when i reset it text messages are back

    can not delete text messages without phone freezing when i reset it text messages are back...help taking up a lot of space.

    Try this...
    Close out all apps (double click the home button and swipe up) then delete one thread.  Do a hard reset of the phone or ipad, then wait a few minutes and it should be gone.  I just did this with a thread that had thousands of txt and it worked for me.  The older phones just don't have much processing power.

  • Reloading a Page when Browser back button is pressed

    Hi There
    We are designing a web site in which all the pages are dynamic depending on what he does with his email and addressbook system. Problem is when the uers request a change to the his email accounts or addressbook entries he is sent to editable pages .After editing he is sent back to view page .Now when he uses the back button he sees the old record that he modifed which i dont want to do that Instead i want him to show the updated version of that page
    Now how to achieve this.
    Is there any way to send a request to the server everytime the back button is pressed.
    Also i am trying to remoce the cache using the code below but it does not work i just dont know why?
    response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setHeader("Expires" , "0");
    Any help would be appreciated.
    Thanks.
    Mumtaz

    I also have noticed that in the latest version of Explorer it ignore the no-Cache header when the back button is pressed. Is this an undocumented "feature" put in place by MS or is there a newer header tag that needs to be set. The no-cache and expires tags work fine in Netscape and ealier versions of MS with my existing code. The version I am having difficulties with is 6.00
    Thanks

  • When using Firefox as my browser, my "back" button no longer works? And by the way...getting help is a real pain in the butt on this site!!!!!

    When using Firefox as my browser, my "back" button no longer works? And by the way...getting help is a real pain in the butt on this site!!!!!

    see -- http://kb.mozillazine.org/Kill_application
    which explains how to completely exit (quit) your Mozilla application
    Try closing Firefox completely
    *Close Firefox properly '''File > Exit''', not with the "X" which just closes the window.
    *Use the Windows Task Manager "Processes" tab to make sure that firefox.exe is not running and also that the plugin-container.exe is not running.
    If that does not work, try restarting the system.
    If still no luck try restoring bookmarks from last backup, or better create your own .json backup and restore from that.
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox#Creating_bookmark_backups
    *''If you had to go this far, please provide feedback if restoring bookmarks alone fixed the problem. I think I may have done that once with success, but never see that suggested -- I'd try most anything to not lose history or bookmarks. But then I could restore files from my profile and restore latest bookmarks backup from current profile.''
    The following will result in complete loss of history if it comes down to deleting places.sqlite, so rename files rather than deleting. With Firefox down.
    Of course you have backups of your profile you could replace rename and
    replace those files instead.
    Locked or damaged places.sqlite - MozillaZine Knowledge Base
    :"Toolbar buttons such as Back/Forward are disabled "
    :http://kb.mozillazine.org/Locked_or_damaged_places.sqlite

  • In Firefox 3.6.10 I was able to go forward and backwards between pages without the page defaulting to the top of the page. Is there any way to prevent the page from automatically moving to the top when using the forwards and back buttons in Firefox Four?

    I like to be able to navigate backwards and forwards without having to scroll down and find where I was previously. In Firefox Four, when using the forwards and back buttons, the page will automatically return to the top of the page. Is there any way to change this setting in Firefox Four to prevent it from doing that?

    Thanks for the response. No Time Machine, but I probably have a backup from a few months ago on an external hard drive. :/ I guess it'd have useful history, but not if it overwrote the last 3 months or so of Awesome Bar, that might not be so great.

  • Unlike IE When back button is pressed it takes too long. pleas do something for that. thnx.

    Unlike IE When back button is pressed it takes too long. pleas do something for that. I like firefox and i get to use the back button more often.
    thnx

    In order to be able to find the correct solution to your problem, we require some more non-personal information from you. Please do the following:
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the submenu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

  • Disable page display when back button is pressed after logout

    hi,
    I dont want the old pages to appear once the back button is pressed after loggin g out. That is .... when logged in, if the user presses back button then his previous pages must be shown....but once the user logs out and then if he presses back button then some message like session has been closed....like message should be displayed.
    Hope you understood the problem

    If you expire a page then back button will not take it to the previous page.
    expire is a HTTP-EQUIV meta tag in the header of the page. You can set the content to some time in the "past" when serving the page first time.
    Expires
    This tells the browser the date and time when the document will be considered "expired." If a user is using Netscape Navigator,
    a request for a document whose time has "expired" will initiate a new network request for the document.
    An illegal Expires date such as "0" is interpreted by the browser as "immediately." Dates must be in the RFC850 format, (GMT format):
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> Hope this works for you, there are browser dependencies as well.
    vr,
    Sudhakar B.

  • How do i unfreeze my ipod when ive already tried the menu and select button and that didnt help?

    how do i unfreeze my ipod when ive already tried the menu and select button and that didnt help?

    How long did you press and hold both the Select (Center) and Menu buttons together?  Have you tried doing this procedure more than once?  Is the hold switch in the Off position?
    If nothing else, let the iPod's battery fully drain. Then charge it back up again.
    B-rock

  • How to go to previous page in windows phone 8 when back button is pressed

    I have a home page or landing page in my windows phone c# based app where user enters login details and upon successful login user is redirected to page2 . Here the user will see a list box with few items . Upon selecting an item from this list box a new
    page called "Threadx" opens.(where x is the each page that opens upon clicking the x item in the list box)
    While user is on this Thread page "Threadx" he may receive the toast notifications and the thread gets updated with new replies or answers on that thread.
    But When user clicks on back button the "ThreadX" page doesn't get closed and instead it goes to its previous state where it has less number of messages , and so on until the app gets closed.
    protected override void OnNavigatedTo(NavigationEventArgs e)
    base.OnNavigatedTo(e);
    if (e.NavigationMode == NavigationMode.Back)
    return;
    I would like to know if this "Threadx" page can be closed upon clicking back button without affecting other "Threadx+1","Threadx+2"..."Threadx+n" pages.
    Any help would be really appreciated.

    you don't need to navigate explicitly. Just clear the back stack till your specific page and say goback. below is the  code you can use.
     protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
                        e.cancel=true;
                    RemoveBackStackTillSpecificPage("page2.xaml");
                    GoBack();
    public static void RemoveBackStackTillSpecificPage(string pageName)
    PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
    var previousPage = frame.BackStack.FirstOrDefault();
    if (previousPage != null && previousPage.Source != null)
                    while (!previousPage.Source.ToString().Contains(pageName))
                        frame.RemoveBackEntry();
                        previousPage = frame.BackStack.FirstOrDefault();
            public static void GoBack()
                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
                LastPageUri = frame.Source;
                frame.GoBack();
    Please mark this as answer if this answers your question
    Purushothama V S

  • Keyboard and back button unavailable when talking to phone

    While I am under a phone call if I want to search the browser or sending a text message the keyboard will be unavailable so do the back button will become unavailable
    Solved!
    Go to Solution.

    Can you check if the same occurs in safe mode?
    http://talk.sonymobile.com/t5/FAQ/How-to-boot-your-phone-into-safe-mode/m-p/348008
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • HT5654 my iphone 5 fell did not break but went completely black and non responsive. When I plug it to the computer I get a white screen with black apple. When I push both the Top and Homne buttons simultaneously I get the charger picture plug end plus arr

    my i phone 5 was dropped, didn't break but went completerly black screen and nonresponsive. I pushed both the home button and top button no response. I plugged it to the computer it gave me white screen with black apple. I pushed the home and the top went black then gave the itune and the charging plug picture. I tried to download and update, the message came as couldn't restore due to unknow error. Any help??

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • How to retain the java applet generated code when back button is pressed!!

    I've a jsp page in which i've wirtten the code which specifies the word which i write in the text box, then through the applet i'm showing the word which is written in the text box. It means my applet is running and it show the words which i've written in the text box. Now when i click on submit it goes to the next page and when i click on browser's back button then except the applet generated code everyone retains its values. Is there any way to find it out when it encounter the back button click then applet should be restarted. so in this way without writing the whole application form and in the applet generated code i can submit it again.
    My question is how do i reatin the applet generated code when a click button is being pressed (b'coz for the textbox, textareas everything retains it)
    any suggestions or guidance are most welcome.
    thanks in advance....

    you don't need to navigate explicitly. Just clear the back stack till your specific page and say goback. below is the  code you can use.
     protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
                        e.cancel=true;
                    RemoveBackStackTillSpecificPage("page2.xaml");
                    GoBack();
    public static void RemoveBackStackTillSpecificPage(string pageName)
    PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
    var previousPage = frame.BackStack.FirstOrDefault();
    if (previousPage != null && previousPage.Source != null)
                    while (!previousPage.Source.ToString().Contains(pageName))
                        frame.RemoveBackEntry();
                        previousPage = frame.BackStack.FirstOrDefault();
            public static void GoBack()
                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
                LastPageUri = frame.Source;
                frame.GoBack();
    Please mark this as answer if this answers your question
    Purushothama V S

Maybe you are looking for

  • Changing font in Oracle Report in PDF output

    Hi, I have created reports using dev10g(report builder). I can run report from client side in pdf format but I want to change the font (i.e from courier to Arial narrow). How can I do this? Is there anyone who can help me? my unifont.ali file is: # $

  • Wireless network printing from macbook to windows XP

    We have a wireless router (netgear) setup with 3 XP computers. A canon i900d printer is directly connected to the main computer. All computers share the internet and printer perfectly. I have the macbook recognizing the network and sharing the intern

  • 051 routine between sales order and delivery copy control

    Hi, The copy control routine 051 in copy control from sales order to delivery defines four combination criteria. 1) delivery types same in config of sales doc type 2) sales org same of the sales orders 3) delivery indicator same 4) billing type same

  • Using lightroom 5.6 and Photoshop elements 12

    When I am using Lightroom 5.6 and want to Edit In Photoshop the picture transfers over to PS but it won't allow me to use layers.  How can I fix this?

  • Integrate my Muse site in Business Catalyst

    Hello, I am considering hosting my website to BC. I created my website with Muse and I would like to use the BC's CMS features on it. Do I have to recreate the whole website with BC or I can "import" my Muse's website into BC's template ? Thanks Esth