2

ユーザーが Android モバイルのギャラリーで画像を開くと、このメニューにリストされているアプリケーションを介してこの画像を共有するオプションがあります。したがって、この共有メニューにアプリを表示し、ユーザーがクリックすると、アプリが起動し、共有する画像のファイルパスを取得します。今私はこれらを試しています:

MyApp-app.xml への書き込み

<android>
    <manifestAdditions><![CDATA[
        <manifest android:installLocation="auto">
        <application>
            <activity android:excludeFromRecents="false">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                <intent-filter>
                    <action android:name="android.intent.action.SEND" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <data android:mimeType="image/*" />
                </intent-filter>
                </activity>
        </application>
            <uses-permission android:name="android.permission.INTERNET"/>
        </manifest> 
    ]]></manifestAdditions>
</android>

アプリ内で使用する画像のファイルパスを取得するには? 私はmxmlファイルにこのコードを書き込もうとしています:

protected function application_preinitializeHandler(event:FlexEvent):void
        {
            NativeApplication.nativeApplication.addEventListener(
                InvokeEvent.INVOKE, onInvoke);
        }

        private function onInvoke(event:InvokeEvent):void
        {
            // some code to get filepath of Image
        }
4

1 に答える 1