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
Contributor
Posts: 15
Registered: ‎01-26-2011
My Device: Curve 8520 Black
My Carrier: TIM BRAZIL

Camera error: multiple change listeners not allowed

Hi all! I'm developing one application that uses camera. When I press the trackball a exception is launghed with a message: " multiple change listeners not allowed". Can any person help me with this?

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

Re: Camera error: multiple change listeners not allowed

You will need to debug this, figure out which line is throwing this exception and review the code.  If you don't see what is going on, please paste a snippet in here for further comment. 

Contributor
Posts: 10
Registered: ‎07-18-2012
My Device: BlackBerry 9800
My Carrier: home

Re: Camera error: multiple change listeners not allowed

Mulitiple change listner is occur most of the time just because of, we were trying to set same listner again and again

 

Try following piece of code, it will throw IllegalStateException: Multiple change listner not allowed

 

ButtonField btnClick = new ButtonField("Click Me");

 

btnClick.setChangeListner(this);

 

//here I can assign listner two times to same field

 

btnClick.setChangeListner(this);

Highlighted
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Camera error: multiple change listeners not allowed

you can only set a single changelistener.
----------------------------------------------------------
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