Révision d752dab7 TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs

Voir les différences:

TestXamConnections/TestXamConnections.Android/Receivers/IntentReceiver.cs
8 8
using System.Collections.Generic;
9 9
using System.Linq;
10 10
using System.Text;
11
using TestXamConnections.Models;
11 12

  
12 13
namespace TestXamConnections.Droid.Receivers
13 14
{
14 15
    public class IntentReceiver : BroadcastReceiver
15 16
    {
16

  
17
        public EventHandler<string> OnInternDataReceived;
17
        public EventHandler<Intent> OnIntentReceived;
18 18

  
19 19
        public override void OnReceive(Context context, Intent intent)
20 20
        {
21
            StringBuilder sb = new StringBuilder();
22
            sb.Append("Action:  " + intent.Action + "\n");
23
            sb.Append("URI: " + intent.ToUri(IntentUriType.Scheme).ToString() + "\n");
24
            string log = sb.ToString();
25
            OnInternDataReceived.Invoke(this, log);
21
            OnIntentReceived(this, intent);
26 22
        }
27 23
    }
28 24
}

Formats disponibles : Unified diff