jeudi 7 juillet 2016

Android Share and open XML file

The user of my app can create a custom list with parent and child items. I store these informations in a xml file. I would like to give the user the opportunity to share this file (Email etc.). If the other user clicks on this file I would like to open the app and show the data in my list!

What Ive done so far: The user can create a xml-file and save it in his storage. The problem now: How to open the app when clicked on the file? Do I have to create my own file extension that has the xml data inside?

EDIT:

<activity
            android:name=".activities.TrainingSimpleShowActivity"
            android:label="@string/title_activity_training_simple_show"
            android:screenOrientation="portrait">

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="file"
                    android:host="*"
                    android:pathPattern=".*\.xml"
                    android:mimeType="*/*"  />
            </intent-filter>

        </activity>

Aucun commentaire:

Enregistrer un commentaire