Эмуляция трансляции в Android

Мне нужно знать, как эмулировать широковещательный приемник.

У меня есть следующий код, но я понятия не имею, как на самом деле увидеть, когда он получает широковещательную рассылку.

public class LocationBroadcastReceiver extends BroadcastReceiver 
{
@Override

public void onReceive(Context context, Intent intent) {


    Bundle b = intent.getExtras();
    Location loc = (Location)b.get(android.location.LocationManager.KEY_LOCATION_CHANGED);

    Toast.makeText(context, loc.toString(), Toast.LENGTH_SHORT).show(); 
    Log.d("com.dennis.test","LOCATION:  " + loc.toString());


}
}

В моем манифесте у меня есть следующее:

<receiver android:name="com.dennis.test.LocationBroadcastReceiver">
    <intent-filter>
        <action android:name="android.location.LocationManager.KEY_LOCATION_CHANGED" />
    </intent-filter>
</receiver>
6
задан Gaffi 13 June 2012 в 20:48
поделиться