- Home /
How to call my activity in unity project?
How to call my activity in unity project.
I made an android project plugin(jar) and i will call startActivity of that.
This activity recieve the intent and show the webview when it starts.
I will try below with C#, but i can not success in unity project.
I made the class extends UnityPlayerActivity in my plugin.
example:public static UnityPlayerActivity Instance;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Instance = this;
Intent intent = new Intent(UnityPlayer.currentActivity, myClass(this));
UnityPlayer.currentActivity.startActivity(intent);
}I call an activity in unity project with C#.
example:AndroidJavaClass cls = new AndroidJavaClass(package name .my class name);
AndroidJavaObject obj = cls.GetStatic(cls);
obj.Call("startActivity" , parameter);
I would appriciate it if you could reply to my question.
Your answer
![](https://koobas.hobune.stream/wayback/20220613081718im_/https://answers.unity.com/themes/thub/images/avi.jpg)