document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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. }
');