Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Aman_vivek
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520

Re: how to open picture gallery with camera

[ Edited ]

you can use below code to open BlackBerry Gallery to select picture, below code open the gallery picker and return path of the image. Path may return null or blank string if you are chossing wallpaper or device secrict images.

 

private String openPictureFloder()
    {
        String selectedImagePath="";
        
        final FilePicker fp=FilePicker.getInstance();
        fp.setFilter(".jpg");
        
        fp.setListener(new Listener()
        {
            public void selectionDone(String arg0)
            {
                selectedImagePath=arg0;
            }
        });
        
        fp.setView(FilePicker.VIEW_PICTURES);
        fp.show();
        return selectedImagePath;
    }

 I hope this will work for you

Regular Contributor
nyerunkar
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700

Re: how to open picture gallery with camera

amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_FILE_EXPLORER, ApplicationDescriptor.currentApplicationDescriptor()));

giving compile error ...
Thanks .,
Nilesh .
Regular Contributor
nyerunkar
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700

Re: how to open picture gallery with camera

giving compile error
Thanks .,
Nilesh .
Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: how to open picture gallery with camera

[ Edited ]

I'm guessing that 'ApplicationDescriptor' is not recognized (-> it should be imported) or you have too many ')'.

 

Am I right?

 

 

Regular Contributor
nyerunkar
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700

Re: how to open picture gallery with camera

Sorry actually its my problem i write wrong code ...now i'm trying compile successfully...
Thanks .,
Nilesh .
Regular Contributor
nyerunkar
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700

Re: how to open picture gallery with camera

Thanks a lot maadani .,

finally you solved my problem ....

 

 

 

Thanks .,

Nilesh

Thanks .,
Nilesh .
Regular Contributor
nyerunkar
Posts: 74
Registered: ‎12-30-2010
My Device: Blackberry Bold 9700

Re: how to open picture gallery with camera

hey maadani i got all answer from you .thanks alot again...

 

i'm getting Path when i click on userDefined Menu.... but i need to go in menu is it possible when user click on center trackpad my menu get execute ...........?

 

Thanks .

Nilesh

 

Thanks .,
Nilesh .