我需要找到當前由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