roaming detection in android
<p>I'm trying  to detect when the roaming activation occurs. So far I've used the following piece of code, but because I haven't been able to test it I am unaware of it's correctness</p>

<pre><code>TelephonyManager telephonyManager = TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); 

PhoneStateListener cellLocationListener = new PhoneStateListener() {
public void onCellLocationChanged(CellLocation location) {
  if(telephonyManager.isNetworkRoaming()
  {
    Toast.makeText(getApplicationContext(),"in roaming",Toast.LENGTH_LONG).show();
   }
 }
};

telephonyManager.listen(cellLocationListener, PhoneStateListener.LISTEN_CELL_LOCATION);
</code></pre>

<p>I've written this , thinking that in order for roaming to activate first the signal cell must change. Please let me know whether my deduction is correct or not, and if not how could I accomplish this.</p>
