Question: I am working on unity android project.
I have called the android side methods from unity like this

```
AndroidJavaObject aObj = new AndroidJavaObject("com.mypackage.UnityBridge",param1,param2);
aObj.Call("callme");

```

And on Android side 

```
public class UnityBridge{

public UnityBridge(final String param1, final int param2) {

        activity = UnityPlayer.currentActivity;
        this.param1= param1;
        this.param2= param2;        
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {                         
                // INITIALIZATION OF ANDROID CLASS CONSTRUCTOR HERE             
            }
        });
    }   

public void callme() {
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {             
                if(obj!= null)
                {               
                    // ANDROID METHOD CALL HERE
                }            
            }
        });
    }

```

This much is working perfectly.

If I want to call Activity specific methods like **onPause()**, **onResume()**, so there is a method in unity to do so.

```
void OnApplicationPause(bool pauseStatus) {
// HERE I CAN CALL activity specific **onPause()** and **onResume()** based on pauseStatus
}

```

Is there anything in unity from which I can give call to **onNewIntent(Intent i)** of Android. If not then how is it possible to call **onNewIntent()**

Please help to resolve this.

Answer: 
I wrote a post how this problem can be solved without overriding Unity activity (its about onActivityResult but the principle is the same): <https://medium.com/@tarasleskiv/unity-android-plugins-and-onactivityresult-callback-abef4b6bbc87#.6d7sl8z81>

Basically you create a custom empty activity and start it just to receive these callbacks and finish it immediately after that.

Check also this post about how to create activity for `onNewIntent` callback: <https://blog.getsocial.im/android-unity-app-and-the-intent-issue/>

Here is the example code of the intermediate activity yo have to create:

```
public class MyDeepLinkingActivity extends Activity
{
    private static String TAG = "GetSocial GetSocialDeepLinkingActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        Log.v(TAG, "Forward the intent");

        // Do with intent what you need to

        Log.v(TAG, "Returning to main activity");
        //start main activity
        Intent newIntent = new Intent(this, getMainActivityClass());
        this.startActivity(newIntent);
        finish();
    }

    private Class<?> getMainActivityClass() {
        String packageName = this.getPackageName();
        Intent launchIntent = this.getPackageManager().getLaunchIntentForPackage(packageName);
        try {
            return Class.forName(launchIntent.getComponent().getClassName());
        } catch (Exception e) {
            Log.e(TAG, "Unable to find Main Activity Class");
            return null;
        }
    }
}

```
Looks like there is no built it way to get `onNewIntent` callback in Unity. However i can suggest to export google android project from unity and override this method in main unity activity

```
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    //some code
}

```

Or you can create android plugin with your own activity which extends unity activity, but keep in mind that some plugins could stop working if you do this.