Problem with calling java function from Unity

Java part in Eclipse:


import com.unity3d.player.UnityPlayerActivity;

public class RootActivity extends UnityPlayerActivity {
    public void onCreate(Bundle savedInstanceState) {

    private void CheckUpdate() {
        UpdateApp task = new UpdateApp();

Unity part:

AndroidJavaClass ajc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
var jc = new AndroidJavaClass("");
jc.CallStatic("CheckUpdate", ajo);

I compile jar file and placed in Unity project. No response when I run the unity part. And the task works well if I place CheckUpdate() in onCreate.

Thanks for help.

I get it work now. I didnt call CheckUpdate() from the main thread, I put it in Update so it’s ok now. Thanks.