Intent i = registerReceiver(null, f
System.out.println(i);
Bundle b = i.getExtras(); for (String key : b.keySet())
{
System.out.print(key);
System.out.print(" => ");
System.out.println(b.get(key));
}
prints Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000000 (has extras) } networkInfo => NetworkInfo: type mobile[UMTS], state CONNECTED/CONNECTED,
reason simLoaded,
... [elided] reason => simLoaded extraInfo => internet inetCondition => 0 Although it is possible to use the long-form of the registerReceiver()
method in this way there is effectively no point since the permission argument has no effect. For example,
replacing the line Intent i = registerReceiver(null,
fin the example above with Intent i = registerReceiver(null, f, "xper.permission.NO_SUCH_PERMISSION", null does not change the behaviour at all.
Share with your friends: