BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-03-2009, 07:22 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with RadioStatusListener

Please Login to Remove!

hi,
i need to implement a class that will register if user connects to the internet, for how long, if he receives any data etc. i've started with implementing a class that would implements RadioStatusListner but it simply does not work.
here is the code:
Code:
InternetInfo _internetInfo = new InternetInfo();
UiApplication.addRadioStatusListener( _internetInfo);

public class InternetInfo implements RadioStatusListener{

  Nouvelle _nouvelle;

	public InternetInfo(){
	  _nouvell = new Nouvelle();
	};
	
	public void baseStationChange(){
		_nouvelle.attention("1");

	}
	
	public void networkScanComplete(boolean _success){
		_nouvelle.attention("2");

	}
	
	public void networkServiceChange(int _networkID, int _service){
		_nouvelle.attention("3");

	}
	
	public void networkStarted(int _networkID, int _service){
		_nouvelle.attention("4");

	}
	
	public void networkStateChange(int _state){
		_nouvelle.attention("5");

		
	}//end of networkStateChange
	
	public void pdpStateChange(int _apn, int _state, int _cause){
		_nouvelle.attention("6");

	}
	
	public void radioTurnedOff(){
		_nouvelle.attention("7");

	}
	
	public void signalLevel(int _level){
		_nouvelle.attention("8");

	}
	
	
}


where Nouvelle.attention:

	public void attention(String data)
	{
	_ui = Ui.getUiEngine();
	_screen = new Dialog(Dialog.OK, data, Dialog.OK,
		Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),
				Manager.VERTICAL_SCROLL);
		
		_ui.queueStatus(_screen, 1, true);
		
	}
but nothing happens. i mean-i use the browser, went to some page, turned off/on network and nothing! none of these alerts appears..

Can anyone help me with that?

kind regards
Offline  
Old 07-03-2009, 08:39 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

looks like i had a bug, not related to this code. it works fine!

kind regards
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.