Совместное использование не удалось, в API 23, только сбой для WhatsApp, после выбора WhatsApp из Chooser, он возвращается на страницу Sharer
кроме WhatsApp, мое приложение делится контентом со всеми другими приложениями, такими как Hike Hangout Mail, Messenger и т. д. Мой SDK компиляции и SDK назначения является 23
это мой код
if (url.startsWith("share://")) {
Intent share = new Intent(Intent.ACTION_SEND);
Uri requestUrl = Uri.parse(url);
String pContent = requestUrl.toString().split("share://")[1];
String pasteData = pContent+"";
share.setAction(Intent.ACTION_SEND);
share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Toast toast=Toast.makeText(getApplicationContext(),pasteData, Toast.LENGTH_LONG);
toast.setMargin(50,50);
toast.show();
StringBuilder sb = new StringBuilder();
String [] parts = pasteData.split("<br />");
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
sb.append(part);
sb.append('\n');
}
share.putExtra(android.content.Intent.EXTRA_TEXT, (Serializable) sb);
share.setType("*/*");
startActivity(Intent.createChooser(share, "Share On"));
return true;
позвольте мне прояснить, этот код работает (совместное использование контента) хорошо для всех других приложений, но не в WhatsApp
моя ошибка logcat
07-29 12:13:20.068 560-578/? I/ActivityManager: Displayed android/com.android.internal.app.ChooserActivity: +392ms (total +21s340ms)
07-29 12:13:29.337 560-1486/? I/ActivityManager: START u0 {act=android.intent.action.SEND typ=*/* flg=0xb080001 cmp=com.whatsapp/.ContactPicker clip={*/* T: first line content
second line content
thired line content
fourth line content
} (has extras)} from uid 10281 on display 0
07-29 12:13:29.609 9651-9674/com.example.app I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
07-29 12:13:29.609 9651-9674/com.example.app I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
07-29 12:13:29.609 9651-9674/com.example.app I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
07-29 12:13:29.678 30472-30703/? I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
07-29 12:13:29.678 30472-30703/? I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
07-29 12:13:29.678 30472-30703/? I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3
07-29 12:13:29.684 560-572/? I/memtrack_graphic: graphic_memtrack_get_memory match 4: ion_mm_heap 30448 7864320 11 c3f0dc40 de902b00
: 30448 30448 7864320 11 714938
07-29 12:13:29.716 560-569/? I/art: Background partial concurrent mark sweep GC freed 60007(3MB) AllocSpace objects, 5(100KB) LOS objects, 33% free, 28MB/42MB, paused 2.514ms total 199.165ms
07-29 12:13:37.046 21901-22266/? I/ClearcutLoggerApiImpl: disconnect managed GoogleApiClient