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
Posts: 813
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Screen Must not be null

final ObjectChoiceField ma4 = new ObjectChoiceField("Group By",choices,iSet)
	        {
        		protected void fieldChangeNotify(int context) {
  	        		// TODO Auto-generated method stub
  	        		//super.fieldChangeNotify(context);
  	        		final int sa = getSelectedIndex();
  	        		
  	        		
  	        		GlobalValue.downList = new Vector();
  	        		
  	        		
			    	if(GlobalValue.downList.size() == 0)
			    	{
			    		synchronized(GlobalValue.pol)
	             		{
			    			if(sa == 1)
			    				GlobalValue.pol.getPlayListTrack(GlobalValue.downList);
			    			else if(sa == 2)
			    				GlobalValue.pol.getPlayListTrack(GlobalValue.downList);
			    			else
			    				GlobalValue.pol.getPlayListTrack(GlobalValue.downList);
			    			synchronized (UiApplication.getEventLock()) 
							{
				    			UiApplication.getUiApplication().popScreen();
				    			try
				    			{
				    				UiApplication.getUiApplication().pushScreen(new Library1(sa));
				                       
				    			}
				    			catch(final Exception e)
				    			{
				    				 UiApplication.getUiApplication().invokeLater(new Runnable() 
								      { public void run()
								          {
											Status.show(e.getMessage());
											}});
				    			}
							}
	             		}
			    		
			    	}
			    		
  	        		
        		}

 

 

when I try to push the bolded part, I get removescreen: screen must not be null...

 

why so?

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

Re: Screen Must not be null

that should be solvable using the debugger.
set an exception breakpoint on nullpointerexception, if that does not help check your variable values.
----------------------------------------------------------
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