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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Developer
Posts: 33
Registered: ‎12-26-2013
My Device: 8760
My Carrier: airtel

Re: Unexpected Behavior of File picker

Hi  @peter you can see the alert dilog here on click of alert dialog its firing

if (field == click) {
Dialog.alert("OK");

try {
FilePicker filePicker;
filePicker = FilePicker.getInstance();
filePicker.setPath("file:///store/home/user/pictures/");
filePicker.setListener(new Listener() {
public void selectionDone(String path) {
bitmapField.setBitmap(getTheImage(path));
Dialog.alert(path);
}
});
filePicker.show();// it show what ever you select.
} catch (Exception e) {
System.out.println("Caught " + e);
}
}

 

and here you are taking about Also I don't see a filePicker.show().  So how does the FilePicker get displayed?

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unexpected Behavior of File picker

Got that - see my edit on my previois post. 

 

Other points from my post are still applicable and need your action. 

Developer
Developer
Posts: 33
Registered: ‎12-26-2013
My Device: 8760
My Carrier: airtel

Re: Unexpected Behavior of File picker

@peter thanks for giving suggestion But issues remains same

Here Is modified code what u have suggested.

 

if(field==click)
{

try {
FilePicker filePicker;
filePicker=FilePicker.getInstance();
filePicker.setPath("file:///store/home/user/pictures/");
filePicker.setListener(new Listener() {
public void selectionDone(String path) {
bitmapField.setBitmap(getTheImage(path));
//Dialog.alert(path);
}
});
filePicker.show();// it show what ever you select.
} catch (Exception e) {
System.out.println("Caught " + e);

 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Unexpected Behavior of File picker

add
more
logging
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Developer
Posts: 33
Registered: ‎12-26-2013
My Device: 8760
My Carrier: airtel

Re: Unexpected Behavior of File picker

@simon what logging I am not getting you I have DOUBT with the path

please correct me whether I am correct or wrong

 

("file:///store/home/user/pictureses/");

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Unexpected Behavior of File picker

you don't have to set a path. if you think it might cause the issue, remove the line.

it is generally advisable to simplify non-working code until it works.
add functionality step by step, if one step results in the code no longer working you know where the issue is.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Developer
Posts: 33
Registered: ‎12-26-2013
My Device: 8760
My Carrier: airtel

Re: Unexpected Behavior of File picker

i s there any one who find the solution for this 

Please help me.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unexpected Behavior of File picker

You don't seem to understand that we have not been able to help you find a solution, because you have not managed to describe the problem accurately.   

 

Neither SImon nor I know which statements in your code are being executed, and which are not - I suggested you debug, Simon suggested logging, but you appear to have done nothing.  

 

Also you don't appear to be using standard problem resolution techniques here - as Simon said

"it is generally advisable to simplify non-working code until it works.
add functionality step by step, if one step results in the code no longer working you know where the issue is."

 

For example, in this case, since you suspect the path has something to do with using 'store' (I agree it might), you could try a File Picker that does not start in "store".  You could use code from this KB article:

http://supportforums.blackberry.com/t5/Java-Development/Programmatically-determine-if-a-microSD-card...

to actually check if store is even available.

 

Or you could write a simple program that just has a FIlePicker?  Or you could try a SImulator for the 9780 to see if there is a problem with your test 9780? 

 

So we are looking for effort from you to help resolve your problem.  It seems fair to me that, since it is your problem,  you should be happy to invest some of your time to help try to find the issue.  Does that seem fair to you? 

Developer
Developer
Posts: 33
Registered: ‎12-26-2013
My Device: 8760
My Carrier: airtel

Re: Unexpected Behavior of File picker

@peter and Simon thanks i solved that issue by adding two line of code.

 

filePicker.setView(FilePicker.VIEW_PICTURES);
filePicker.setFilter(".jpg:.bmp:.png");

 

its workin now happy.