Log in or register to post comments

Unable to reopen the vuforia camera

May 9, 2014 - 2:51am #1

Hi sir,

Actually i am facing one problem regarding the camera in vuforia Books sample.

what i am doing?

i am making an app,in which i am having one view and one ARbutton overthere.

After that when i click on that ARbutton first time then it successfully open the camera and on camera overlay i have attached one close button.

when i press that close button it takes me to back on my last view where the ARbutton is lying,and also on that close button activity i am deinitializing the qcar.

and then when i press the ARbutton again it is showing me a blackscreen but not opening the camera.

 

(1) This is my ARbutton activity?

- (IBAction)ARbutton9:(id)sender {   

    if (self.appViewControllerClassName == NULL) {        

        self.appViewControllerClassName = @"BooksViewController";

    }       

    bookview = [[[BooksViewController alloc] initWithNibName:nil bundle:nil]autorelease];

    if (firstTime == YES) {

                firstTime = NO;

    }

    [self presentModalViewController:bookview animated:YES];

    //Class vcClass = NSClassFromString(self.appViewControllerClassName);

    //id vc = [[vcClass alloc]  initWithNibName:nil bundle:nil];    

    //[self.navigationController pushViewController:view animated:NO];

    //[vc release]; // don't leak memory

#ifdef OLD

    SampleAppSlidingMenuController *slidingMenuController = [[SampleAppSlidingMenuController alloc] initWithRootViewController:vc];    

    [self.navigationController pushViewController:slidingMenuController animated:NO];

    [slidingMenuController release];

    [vc release];// don't leak memory

#endif    

}

 

(2) This is my closebuttonactivity?

 

- (void)closeButtonTapped:(id)sender {

    [QCARHelper stopDetection];

    [vapp stopCamera:nil];

    [eaglView finishOpenGLESCommands];

    exitButton.hidden = YES;

    [self.parentViewController dismissModalViewControllerAnimated:YES];

    [vapp release];

    QCAR::deinit();

    self.parentViewController.view.hidden = YES;

    

    SampleAppAboutViewController *view = [[SampleAppAboutViewController alloc]initWithNibName:@"SampleAppAboutViewController" bundle:nil];

    view.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    [self presentModalViewController:view animated:YES];  

   

 

}

Unable to reopen the vuforia camera

May 13, 2014 - 8:30am #2

In general we recommend using Pause and Resume functionality to achieve this type of functionality because it is less likely to cause any problems and it is faster.

 

HTH

N

Log in or register to post comments