0
我可以通過這個代碼檢測如何阻止boradcast接收器接收動作?
Intent intent = new Intent(
LocationChangedReciever.ACTION_LOCATION_CHANGED);
LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
long minTime = 1000; // This should probably be fairly long
float minDistance = 1; // This should probably be fairly big
String provider = "gps"; // GPS_PROVIDER or NETWORK_PROVIDER
PendingIntent launchIntent = PendingIntent.getBroadcast(this,
0, intent, 0);
manager.requestLocationUpdates(provider, minTime, minDistance,
launchIntent);
我做了一個我的按鈕點擊我的位置更新開始廣播接收器,但一旦我點擊該按鈕,接收機開始對所有的時間工作,但我有一個停止按鈕,將禁用接收器,但我無法做到這一點,除非我卸載它,任何幫助,這個接收器的工作?
謝謝它工作:) – Reyjohn 2013-02-24 18:33:09