我需要找到当前由FragmentActivity显示的片段。如何以编程方式查找当前由FragmentActivity显示的片段?
或者,我需要找到实现给定接口的片段。
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
// Return input text to fragment
AdjustPricesDialogListener fragment = (AdjustPricesDialogListener) ??? // how do I find this fragment?
我该如何做到这一点?
Simmilar问题:http://stackoverflow.com/questions/9294603/get-currently-displayed-fragment – Apfelsaft 2013-05-03 12:02:05