簡體   English   中英

Android View onResume方法?

[英]Android View onResume method?

當使用返回按鈕返回活動時,

startActivity(new Intent(this, ActivityMainMenu.class));

被稱為,是否有任何方法可以自動轉到自定義視圖?

我注意到回到視圖時,它不再無效。

基本上不使用活動的onResume,我希望能夠恢復我的自定義視圖。

對於其他想知道的人,您可以使用:

protected void onAttachedToWindow()

每次將視圖附加到窗口時都會調用它。

TextViewAndroid源代碼中 ,它post Runnable

    if (ss.error != null) {
        final CharSequence error = ss.error;
        // Display the error later, after the first layout pass
        post(new Runnable() {
            public void run() {
                setError(error);
            }
        });
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM