简体   繁体   中英

Android View onResume method?

When returning to an activity using the back button and

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

is called, are there any methods that automatically go to a custom view?

I've noticed that when going back to the view, it's no longer invalidated.

Basically without using the activity's onResume I want to be able to resume my custom view.

For anyone else who wants to know you can use:

protected void onAttachedToWindow()

It's called every time a view is attached to the Window.

In the Android Source for TextView , it post sa 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);
            }
        });
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM