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
Developer
tej
Posts: 33
Registered: ‎12-26-2013
My Device: 8760

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
peter_strange
Posts: 19,610
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
tej
Posts: 33
Registered: ‎12-26-2013
My Device: 8760

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
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

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
tej
Posts: 33
Registered: ‎12-26-2013
My Device: 8760

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
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

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
tej
Posts: 33
Registered: ‎12-26-2013
My Device: 8760

Re: Unexpected Behavior of File picker

i s there any one who find the solution for this 

Please help me.

Developer
peter_strange
Posts: 19,610
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
tej
Posts: 33
Registered: ‎12-26-2013
My Device: 8760

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.:Clap: