2011-11-26 29 views
0

如何將(添加)proximityalert的意圖轉化爲廣播接收者? 以及如何使接受方法工作?如何將(添加)proximityalert的意圖轉化爲廣播接收者?

Intent locationNotific = new Intent("SendProximityIntent"); 
    locationNotific.putExtra("RowID", id); 
    sendBroadcast(locationNotific); 
    PendingIntent lPendingIntent = PendingIntent.getActivity(this, 0, locationNotific, 0); 

     IntentFilter filter = new IntentFilter("SendProximityIntent"); 

     registerReceiver(new ProximityIntentReceiver(), filter); 


    lm.addProximityAlert((double) locationAlertGeoP.getLatitudeE6(),(double) locationAlertGeoP.getLongitudeE6(), (float) 999999999,(long) 100000,lPendingIntent); 

回答

1

如何獲得從(添加)proximityalert到一個BroadcastReceiver的意圖是什麼?

使用getBroadcast()代替getActivity()和提供一個Intent識別清單註冊BroadcastReceiver