A alexsilva_vs New Member Licensed User Oct 30, 2023 #1 Hello! I'm trying to get an image from the photo gallery, but when trying the example code provided by Erel, it fails because I'm using B4XPages and at startup the camera expects an object of type 'Page'. I didn't find anything like that on the forum and I also tried a few things but nothing worked. The error log: Expected: UIViewController, object type: b4i_cxpgprofile My code: B4X: Copy #If B4i cam.Initialize("cam", MP.CurrentPage) ' Cam = camera; MP = B4XMainPage cam.SelectFromSavedPhotos(Sender, cam.TYPE_ALL) #End If Thanks in advance!
Hello! I'm trying to get an image from the photo gallery, but when trying the example code provided by Erel, it fails because I'm using B4XPages and at startup the camera expects an object of type 'Page'. I didn't find anything like that on the forum and I also tried a few things but nothing worked. The error log: Expected: UIViewController, object type: b4i_cxpgprofile My code: B4X: Copy #If B4i cam.Initialize("cam", MP.CurrentPage) ' Cam = camera; MP = B4XMainPage cam.SelectFromSavedPhotos(Sender, cam.TYPE_ALL) #End If Thanks in advance!
Erel B4X founder Staff member Licensed User Longtime User Oct 31, 2023 #2 [B4X] [B4XPages] Intent based camera This solution will not work with Android 14+. Please use the more powerful MediaChooser instead: [B4X] MediaChooser - cross platform videos and images chooser B4A + B4i project that uses an intent in B4A and the Camera object in B4i to take a picture using the default camera app. The B4A code... www.b4x.com Upvote 0
[B4X] [B4XPages] Intent based camera This solution will not work with Android 14+. Please use the more powerful MediaChooser instead: [B4X] MediaChooser - cross platform videos and images chooser B4A + B4i project that uses an intent in B4A and the Camera object in B4i to take a picture using the default camera app. The B4A code... www.b4x.com