Ejemplo n.º 1
0
        /// <summary>
        /// Send the GCM Token to the Voice Activity.
        /// </summary>
        /// <param name="gcmToken"> The new token. </param>
        private void sendGCMTokenToActivity(string gcmToken)
        {
            Intent intent = new Intent(VoiceActivity.ACTION_SET_GCM_TOKEN);

            intent.putExtra(VoiceActivity.KEY_GCM_TOKEN, gcmToken);
            LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
        }
Ejemplo n.º 2
0
 private void registerReceiver()
 {
     if (!isReceiverRegistered)
     {
         IntentFilter intentFilter = new IntentFilter();
         intentFilter.addAction(ACTION_SET_GCM_TOKEN);
         intentFilter.addAction(ACTION_INCOMING_CALL);
         LocalBroadcastManager.getInstance(this).registerReceiver(voiceBroadcastReceiver, intentFilter);
         isReceiverRegistered = true;
     }
 }
Ejemplo n.º 3
0
 protected internal override void onPause()
 {
     base.onPause();
     LocalBroadcastManager.getInstance(this).unregisterReceiver(voiceBroadcastReceiver);
     isReceiverRegistered = false;
 }