简体   繁体   中英

What kind of intents should I use to save the bug report generated by android device

How can I get my app listed in the app chooser screen when sharing the bug reported generated by the android device. The bug report which can be generated using the USB debugging developers options. I have tried adding all the mime types in the data field. But still I am not able to see my app listed in the app chooser. The bug report generates a .zip file and a .png file. So, I have added application/* and image/* types.

<intent-filter>
    <action android:name="android.intent.action.SEND" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/zip" />
    <data android:mimeType="audio/*" />
    <data android:mimeType="image/png" />
    <data android:mimeType="message/*" />
    <data android:mimeType="multipart/*" />
    <data android:mimeType="text/*" />
    <data android:mimeType="video/*" />
</intent-filter>

I'm not 100% but I believe multiple <data ...> entries in your filter might be tripping you up. In order to debug I would start with a single <data android:mimeType="*/*" /> entry and confirm your application appears in the chooser.

If it does then you could check the Intent.getType() to determine what MIME type is actually being sent. From there you could add multiple filters for every expected type as shown in the documentation .

<activity android:name=".ui.MyActivity" >
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.SEND_MULTIPLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
</activity>

This appears to answer you question for you. Its long so I won't copy it here.

https://stackoverflow.com/a/16232417

android.intent.action.APP_ERROR Seems to be the intent filter you need to support to handle ANR/crash reports.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM