- Home /
Question by
LaloSyn · Mar 31, 2014 at 10:04 AM ·
gameobjectvuforia
Stack Overflow When Trying to Call an Android Activity
Hi, I'm doing an AR App with Vuforia, Unity and Eclipse, so when I touch the gameobject it is supposed to open a Custom Activity from Eclipse but when I call the Activity in C# script from the .jar that generated from Eclipse, Unity just crashes and send an error of Stack Overflow, does anyone know what is generating this error? or maybe I'm not calling the activity properly in the script? I would appreciate any help.
I let the script down here:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Touch : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
RaycastHit hit=new RaycastHit();
for(int i=0;i<Input.touchCount;i++)
{
if(Input.GetTouch(i).phase.Equals(TouchPhase.Began))
{
Ray ray=Camera.main.ScreenPointToRay(Input.GetTouch(i).position);
if(Physics.Raycast(ray,out hit))
{
if(hit.collider.gameObject == this.gameObject)
{
AndroidJavaClass jc = new AndroidJavaClass("com.proyect.arvision.Funciona");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
jo.Call("prueba1");
}
}
}
}
}
}
Comment