JHN*_*ves 8 android share callback android-intent
我正在使用以下代码在我的Android应用程序上分享内容:
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "blah blah blah");
this.startActivity(Intent.createChooser(shareIntent, "Choose a sharing option:"));
Run Code Online (Sandbox Code Playgroud)
我需要知道用户是否共享成功或是否失败.无论如何在共享操作完成时获得回调?
使用startActivityForResult,这样就可以检查响应。请检查: startActivityForResult
如果您需要对流程有更多控制,则不应使用共享意图方法。相反,您可以使用 Twitter4j 库来进行 twitter 操作,并使用适用于 Android 的 Facebook SDK 来进行 Facebook 共享。
| 归档时间: |
|
| 查看次数: |
8281 次 |
| 最近记录: |