Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class BroadcastReceiver : MonoBehaviour
- {
- AndroidJavaClass jc;
- string javaMessage = "";
- void Start()
- {
- // Acces the android java receiver we made
- jc = new AndroidJavaClass("com.test.unitycatchintent.MyReceiver");
- // We call our java class function to create our MyReceiver java object
- jc.CallStatic("createInstance");
- }
- void Update()
- {
- // We get the text property of our receiver
- javaMessage = jc.GetStatic<string>("text");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement