Hi, I'm trying to listen to the android sharing intent (android.intent.action.SEND) to receive a shared picture from the system gallery using AIR SDK 15. I believe I set my app manifest correctly since the app is listed on the sharing options at the phone:
<application> <activity> <intent-filter> <data android:mimeType="image/*" /> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>
At my actionscript class I try to listen to the InvokeEvent.INVOKE event like this (placed on the main class constructor):
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
And my onInovke method is this one:
protected function onInvoke(event:InvokeEvent):void { trace("[Invoked]"); trace("reason: " + event.reason); trace("arguments.length: " + event.arguments.length); }
While trying this, the "onInvoke" method is called without arguments on app startup as expected. However, when the image is shared the app is, indeed, called, but it receives another InvokeEvent without the needed arguments.
Also, this only happens if the app is already running on background. If it is closed, the app is started but only the initial InvokeEvent is called, not the sharing one. This happens no matter what application initiated the sharing on the phone.
Has anyone faced this problem? What am I doing wrong?
Thank you ;-)