teotestbluetooth / TestXamConnections / TestXamConnections.Android / Receivers / IntentReceiver.cs @ 1fd64302
Historique | Voir | Annoter | Télécharger (769 octets)
1 |
using Android.App; |
---|---|
2 |
using Android.Content; |
3 |
using Android.OS; |
4 |
using Android.Runtime; |
5 |
using Android.Views; |
6 |
using Android.Widget; |
7 |
using System; |
8 |
using System.Collections.Generic; |
9 |
using System.Linq; |
10 |
using System.Text; |
11 |
|
12 |
namespace TestXamConnections.Droid.Receivers |
13 |
{ |
14 |
public class IntentReceiver : BroadcastReceiver |
15 |
{ |
16 |
|
17 |
public EventHandler<string> OnInternDataReceived; |
18 |
|
19 |
public override void OnReceive(Context context, Intent intent) |
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); |
26 |
} |
27 |
} |
28 |
} |