我想拦截选择共享意图的用户,如果他们选择 facebook 来启动 facebook sdk。
我对自相矛盾的 API 文档感到困惑。 http://developer.android.com/reference/android/widget/ShareActionProvider.html
public void setOnShareTargetSelectedListener (ShareActionProvider.OnShareTargetSelectedListener listener)
Added in API level 14
Sets a listener to be notified when a share target has been selected. The listener can optionally decide to handle the selection and not rely on the default behavior which is to launch the activity
public abstract boolean onShareTargetSelected (ShareActionProvider source, Intent intent)
Added in API level 14
Called when a share target has been selected. The client can decide whether to perform some action before the sharing is actually performed.
Note: Modifying the intent is not permitted and any changes to the latter will be ignored.
Note: You should not handle the intent here. This callback aims to notify the client that a sharing is being performed, so the client can update the UI if necessary.
一个说你可以拦截一个说你不能拦截。看起来你不能在监听器上玩返回值,但我想知道是否有人有解决方法或解决这个问题。