我有这段代码。
public static void sharedWhatsappOrHandout(Activity destination, String stringShared){
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, stringShared);
sendIntent.setType("text/plain");
sendIntent.setPackage("com.whatsapp");
if (sendIntent != null) {
destination.startActivity(sendIntent);
} else {
sendIntent.setPackage("com.google.android.talk");
if (sendIntent != null) {
destination.startActivityForResult(sendIntent,REQUEST_CODE);
} else {
Toast.makeText(destination, R.string.error_no_whatsapp, Toast.LENGTH_SHORT)
.show();
}
}
}
我如何知道用户是否实际共享或取消了共享活动?