Advertisement
UnSelph

BroadcastReceiver.cs

Feb 17th, 2014
43,732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class BroadcastReceiver : MonoBehaviour
  5. {
  6.     AndroidJavaClass jc;
  7.     string javaMessage = "";
  8.    
  9.     void Start()
  10.     {
  11.         // Acces the android java receiver we made
  12.         jc = new AndroidJavaClass("com.test.unitycatchintent.MyReceiver");
  13.         // We call our java class function to create our MyReceiver java object
  14.         jc.CallStatic("createInstance");   
  15.     }
  16.    
  17.     void Update()
  18.     {      
  19.         // We get the text property of our receiver
  20.         javaMessage = jc.GetStatic<string>("text");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement