private void sendLocalMessage(String tag, DataMap dataMap) { Intent messageIntent = new Intent(); messageIntent.setAction(Intent.ACTION_SEND); messageIntent.putExtra(tag, dataMap.toBundle()); LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent); }
treatsDataMap = getTreatments(startTime); if (treatsDataMap != null) { messageIntent.putExtra("treats", treatsDataMap.toBundle()); messageIntent.putExtra("cals", treatsDataMap.toBundle()); messageIntent.putExtra("bts", treatsDataMap.toBundle()); treatsDataMap = getTreatments(startTime); if (treatsDataMap != null) { messageIntent.putExtra("treats", treatsDataMap.toBundle()); treatsDataMap = getCalibrations(startTime); if (treatsDataMap != null) { messageIntent.putExtra("cals", treatsDataMap.toBundle()); treatsDataMap = getBloodTests(startTime); if (treatsDataMap != null) { messageIntent.putExtra("bts", treatsDataMap.toBundle());
public synchronized static void sendTreatment(String notes) { Log.d(TAG, "sendTreatment WEARABLE_TREATMENT_PAYLOAD notes=" + notes); DataMap dataMap = new DataMap(); dataMap.putDouble("timestamp", System.currentTimeMillis()); dataMap.putBoolean("watchkeypad", true); dataMap.putString("notes", notes); dataMap.putBoolean("ismgdl", doMgdl(PreferenceManager.getDefaultSharedPreferences(xdrip.getAppContext()))); Intent intent = new Intent(xdrip.getAppContext(), Simulation.class); intent.putExtra(WEARABLE_TREATMENT_PAYLOAD, dataMap.toBundle()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); xdrip.getAppContext().startActivity(intent); }
Log.d(TAG, "onMessageReceived WEARABLE_REPLYMSG_PATH send LocalBroadcastManager ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE=" + ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE); final Intent intent = new Intent(ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE); intent.putExtra("data", dataMap.toBundle());//msg LocalBroadcastManager.getInstance(xdrip.getAppContext()).sendBroadcast(intent); break;
Log.d(TAG, "onMessageReceived WEARABLE_REPLYMSG_PATH send LocalBroadcastManager ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE=" + ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE); final Intent intent = new Intent(ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE); intent.putExtra("data", dataMap.toBundle());//msg LocalBroadcastManager.getInstance(xdrip.getAppContext()).sendBroadcast(intent); break;
DataMap stepsDataMap = BgSendQueue.getSensorSteps(mPrefs); if (stepsDataMap != null) { messageIntent.putExtra("steps", stepsDataMap.toBundle()); messageIntent.putExtra("data", dataMap.toBundle()); LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent); if (!mPrefs.getBoolean("enable_wearG5", false)) { dataMap = DataMapItem.fromDataItem(event.getDataItem()).getDataMap(); Intent intent = new Intent(getApplicationContext(), Simulation.class); intent.putExtra(WEARABLE_TREATMENT_PAYLOAD, dataMap.toBundle()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(intent); dataMap = DataMapItem.fromDataItem(event.getDataItem()).getDataMap(); Intent intent = new Intent(getApplicationContext(), Simulation.class); intent.putExtra(path, dataMap.toBundle()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(intent);