I have 2 plugins that I can’t get to work together. I’ve copied over the activities from the one that weren’t in the other, but then I have a problem with both of them using the same intent-filter:
The Activity that has the intent filter would be the first activity to be started when you launch your app.
There can’t be 2 ‘first’ right?
Therefore, you should decide on the first activity that you want your app to launch with and leave the other for later.
When your app has launched, you can then start the second activity that you omitted the intent filter.
This is just a suggestion and not really sure if it works, but you can try:
//Get the 2nd activity that you omitted the intent filter
AndroidJavaClass jc = new AndroidJavaClass ( activity_name_here );
//Call the method to start the activity, you may need to fiddle around and get the Init method for the activity thou…
jc.CallStatic (method_name, parameter);
If you need Unity’s activity as a context/activity :
//Get Unity’s Current Activity
AndroidJavaClass unityClass = new AndroidJavaClass (“com.unity3d.player.UnityPlayer”);
AndroidJavaObject unityActivity = unityClass.GetStatic(“currentActivity”);
Kennethljj is close to the correct answer. You can’t have 2 activities with the same intent of action MAIN and category LAUNCHER. Doing so will give you two application icons, and it is pretty certain that they behavior is NOT what you want.
Typically you are “overriding” the UnityAndroidPlayer (or UnityAndroidNativePlayer). If another plugin has already created a manifest that enables their jar file to extend the Unity AndroidPlayer, then you should modify your plugin to extend THAT class (in your case it looks like QCARPlayerProxyActivity) adding the path to the plugin’s jar file to your classpath when you build your jar file. Then, in the AndroidManifext.xml file, delete the intent-filter for the QCARPlayerProxyActivity, and instead have that intent-filter for your class which now extends that class.
I’m having problems getting vuforia to work with any of the native and social plugins because of this problem. I downloaded eclipse and am trying to figure it out. If anyone has experience can can make an example and hopefully comment it so I can learn how to do it for the future, I’m happy to pay money…
Hi,
If anyone is still in need of making the Devfo NativeAndroid plugin work with Prime31, we have built the Devfo Plugin to incorporate Prime 31, using their Android Activity Sharing – Instructions to make a plugin that needs to override the Unity Activity play nice with others. · GitHub –
Just contact us with your receipt# and we will email it to you. We should hopefully have it in the next Asset Store release.