Problem with calling java function from Unity

Java part in Eclipse:

package com.abc.def;

import com.unity3d.player.UnityPlayerActivity;

public class RootActivity extends UnityPlayerActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    private void CheckUpdate() {
        UpdateApp task = new UpdateApp();
        task.setContext(getApplicationContext());
	    task.execute();
    }
}

Unity part:

AndroidJavaClass ajc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
var jc = new AndroidJavaClass("com.abc.def.RootActivity");
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.