2
任何人都可以幫助我解決這種情況。有沒有什麼辦法來檢測Android碎片中的userInterations?
我爲Android Activity實施了OnUserInteraction()
方法,它對我來說工作正常。
但我也想Fragments
它。我怎樣才能撥打OnUserInteraction()
或有任何其他方式與UI
確定userInteraction
。
任何人都可以幫助我解決這種情況。有沒有什麼辦法來檢測Android碎片中的userInterations?
我爲Android Activity實施了OnUserInteraction()
方法,它對我來說工作正常。
但我也想Fragments
它。我怎樣才能撥打OnUserInteraction()
或有任何其他方式與UI
確定userInteraction
。
在你Activity
,
@Override
public void onUserInteraction() {
super.onUserInteraction();
// Get current fragment
// Redirect to current fragment's one public method
}
先生,其工作已經很好,但我需要在fragments.how相同。我可以知道用戶觸摸用戶界面。 –
目前尚不清楚你想要達到的目的。請[編輯]與[mcve] –
我想關閉我的應用程序,如果它處於空閒模式(背景和前景太).OnUserInteraction正在爲我的活動工作,但我無法實現它的碎片。 –
片段在活動中進行。我不明白你爲什麼認爲你需要在那裏實施該方法。 –