2017-08-29 24 views
12

मैं अपने एंड्रॉइड एप्लिकेशन को एक ईमेल क्लाइंट के रूप में Chooser सूची में जोड़ने का प्रयास कर रहा हूं। हालांकि यह जीमेल और के-9 आवेदन के साथ दिखाई नहीं दे रहा है। इसका परीक्षण करने के लिए मैं व्हाट्सएप एप्लिकेशन चैट की "ईमेल चैट" सुविधा से चैट डेटा साझा करने का प्रयास कर रहा हूं (क्योंकि यह केवल ईमेल ऐप्स दिखाता है)।ईमेल क्लाइंट के रूप में एंड्रॉइड चयनकर्ता सूची में एप्लिकेशन कैसे सूचीबद्ध करें?

मेरे पास केवल एक गतिविधि है। जब मैं ब्राउज़र से टेक्स्ट डेटा साझा करता हूं, लेकिन जब मैं व्हाट्सएप से ईमेल डेटा साझा नहीं करता हूं तो मेरा एप्लिकेशन चयनकर्ता सूची में होता है। मैंने अपने एंड्रॉइडमैनीफेस्ट.एक्सएमएल के निम्नलिखित इरादे की कार्रवाई जोड़ने की कोशिश की लेकिन यह काम नहीं करता है।

 <intent-filter> 
      <action android:name="android.intent.action.SEND_MULTIPLE" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data android:mimeType="text/*" /> 
     </intent-filter> 
     <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/*" /> 
      <data android:mimeType="text/*" /> 
     </intent-filter> 

डिबग से, मैंने पाया कि K-9 लांच किया जा रहा है इस प्रकार है,

08-30 00:27:28.064 489-2302/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only 
08-30 00:27:28.064 1685-2620/? I/ActivityManager: START u0 {act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras)} from uid 10158 on display 0 
08-30 00:27:28.064 489-24642/? I/Thermal-Lib: Thermal-Lib-Client: Client request sent 
08-30 00:27:28.064 753-1089/? I/ThermalEngine: Thermal-Server: Thermal received msg from override 
08-30 00:27:28.077 1685-1997/? W/InputMethodManagerService: Window already focused, ignoring focus gain of: [email protected] attribute=null, token = [email protected] 
08-30 00:27:28.177 1685-1749/? I/LaunchCheckinHandler: Displayed android/com.android.internal.app.ChooserActivity,wp,ca,96 
08-30 00:27:28.177 1685-1749/? I/ActivityManager: Displayed android/com.android.internal.app.ChooserActivity: +96ms 
08-30 00:27:28.244 1685-1845/? D/MotoSensors: ALS 41 
08-30 00:27:28.253 1685-1694/? I/art: Background partial concurrent mark sweep GC freed 57795(3MB) AllocSpace objects, 27(1060KB) LOS objects, 30% free, 36MB/52MB, paused 2.148ms total 160.734ms 
08-30 00:27:28.306 9905-9979/? D/OpenGLRenderer: endAllActiveAnimators on 0x8ea64500 (aq$a) with handle 0x8ee25d30 
08-30 00:27:28.307 1685-2108/? I/WindowManager: Destroying surface Surface(name=PopupWindow:dcadc74) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.removeLocked:1457 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2546 com.android.server.wm.WindowManagerService.removeWindowLocked:2504 com.android.server.wm.WindowManagerService.removeWindowLocked:2373 com.android.server.wm.WindowManagerService.removeWindow:2364 com.android.server.wm.Session.remove:193 
08-30 00:27:28.553 585-645/? I/SFPerfTracer:  triggers: (rate: 14:1327) (1008781 sw vsyncs) (0 skipped) (42:3589810 vsyncs) (44:4764825) 
08-30 00:27:28.707 585-585/? I/SFPerfTracer:  triggers: (rate: 2783:527680) (compose: 1:238) (post: 3:2376) (render: 6:1240) (3:1974551 frames) (4:2171862) 
08-30 00:27:28.707 585-585/? D/SFPerfTracer:  layers: (5:12) (DimLayerController/Stack=0 (0xae241400): 1:9571) (StatusBar (0xae243c00): 4:397491) (com.android.systemui.ImageWallpaper (0xacfb7400): 4:264193)* (Sprite (0xae23ec00): 0:863)* (animation background stackId=1 (0xacfb9c00): 0:1482)* (animation background stackId=0 (0xacfd9c00): 0:12)* (NavigationBar (0xacfb6000): 4:252) (com.whatsapp/com.whatsapp.Conversation (0xacfd6000): 4:230) (PopupWindow:e9ad06f (0xacfb8800): 0:44)- (PopupWindow:dcadc74 (0xacfd7400): 0:44)- (Initializing... (0xacfb8800): 0:2)- (android/com.android.internal.app.ChooserActivity (0xacfb8800): 4:28) 
08-30 00:27:29.343 1685-2562/? I/ActivityManager: START u0 {act=android.intent.action.SEND_MULTIPLE typ=text/* flg=0xb080001 pkg=com.fsck.k9 cmp=com.fsck.k9/.activity.MessageCompose clip={text/* U:content://com.whatsapp.fileprovider/external/WhatsApp/.Shared/WhatsApp%20Chat%20with%20%E2%80%AA%2B91%2096019%2049744%E2%80%AC.txt} (has extras)} from uid 10158 on display 0 

मैं भी डाल type = पाठ/* अपने इरादे फिल्टर में, फिर भी मेरे एप्लिकेशन सूचीबद्ध नहीं है। कोई विचार क्यों? इसे सूचीबद्ध करने के लिए मैं क्या कर सकता हूं?

+0

संदर्भ के लिए मेरे कोड से लिंक करें। https://github.com/sunilshahu/DataReceiver –

+2

क्या आपने यह कोशिश की है: https: // stackoverflow।कॉम/ए/6796128/1048340? –

उत्तर

1

इस प्रयास करें: - मैं यह काम करता है

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

+0

जैसा कि आप देख सकते हैं कि मेरा दूसरा इरादा-फ़िल्टर आपके जैसा ही है। हालांकि सिर्फ मेरी पुष्टि करने के लिए मेरे साथ बदल दिया और यह काम नहीं करता है। कोई अन्य सुझाव बहुत मददगार होगा। –

1

इस reference

<intent-filter> 
    <action android:name="android.intent.action.VIEW"/> 
    <action android:name="android.intent.action.SENDTO"/> 
    <data android:scheme="mailto"/> 
    <category android:name="android.intent.category.DEFAULT"/> 
    <category android:name="android.intent.category.BROWSABLE"/> 
</intent-filter> 
<intent-filter android:label="@string/app_name"> 
    <action android:name="android.intent.action.SEND"/> 
    <data android:mimeType="*/*"/> 
    <category android:name="android.intent.category.DEFAULT"/> 
</intent-filter> 
<intent-filter android:label="@string/app_name"> 
    <action android:name="android.intent.action.SEND_MULTIPLE"/> 
    <data android:mimeType="*/*"/> 
    <category android:name="android.intent.category.DEFAULT"/> 
</intent-filter> 
2

कोशिश मैं सीधे जीमेल APK से बाहर इन आशय फिल्टर खींच लिया आशा ।

यह इरादा फ़िल्टर mailto लिंक संभालता है।

<intent-filter> 

    <action 
     android:name="android.intent.action.SENDTO" /> 

    <action 
     android:name="android.intent.action.VIEW" /> 

    <category 
     android:name="android.intent.category.DEFAULT" /> 

    <category 
     android:name="android.intent.category.BROWSABLE" /> 

    <data 
     android:scheme="mailto" /> 
</intent-filter> 

यह एक mailto उद्देश्य NFC के माध्यम से की खोज की प्रक्रिया करने के लिए अनुमति देता है।

<intent-filter> 

    <action 
     android:name="android.nfc.action.NDEF_DISCOVERED" /> 

    <category 
     android:name="android.intent.category.DEFAULT" /> 

    <data 
     android:scheme="mailto" /> 
</intent-filter> 

यह एक प्रतिक्रिया के रूप में आपका ऐप्लिकेशन खोलने को उद्देश्य और "Ok Google, note to self" voice command भेजने देता है।

<intent-filter> 

    <action 
     android:name="android.intent.action.SEND" /> 

    <category 
     android:name="android.intent.category.DEFAULT" /> 

    <category 
     android:name="com.google.android.voicesearch.SELF_NOTE" /> 

    <data 
     android:mimeType="*/*" /> 
</intent-filter> 

यह एक बार में send multiple items (represented by Uris) की अनुमति देता है।

<intent-filter> 

    <action 
     android:name="android.intent.action.SEND_MULTIPLE" /> 

    <category 
     android:name="android.intent.category.DEFAULT" /> 

    <data 
     android:mimeType="*/*" /> 
</intent-filter> 

जीमेल डोमेन के लिए दो और विशिष्ट थे जो प्रासंगिक नहीं हैं और मैंने छोड़ा है।

अपने आप को सत्यापित करने के लिए:

  1. प्राप्त एक जीमेल APK।
  2. एंड्रॉइड स्टूडियो में मुख्य मेनू> बिल्ड> एपीके का विश्लेषण करें ...
  3. फ़ाइल पिकर का उपयोग करके जीमेल एपीके ढूंढें और खोलें।
  4. एपीके विश्लेषक में AndroidManifest.xml का चयन करें।

आपके ऐप पर पहुंचने के बाद इरादे को प्रोसेस करना दायरे से बाहर है।

संबंधित मुद्दे

 संबंधित मुद्दे