Unable to add window-token android.os.binderproxy@3a067204 are not valid error analysis record

Source: Internet
Author: User

When you open the app, there's a flashback, and you'll see an error message from Android Studio, mainly:

Unable to add window – Token [email protected] is not valid

Cause analysis: Because a progress dialog box appears when you enter the app, the dialog's initialization must depend on activity, but if the dialog's initialization is placed in the activity's OnCreate method, an error will be made.

Because the activity is not created when the OnCreate method executes according to the activity's life cycle, the activity on which the dialog is dependent does not exist, so the initialization dialog must be an error.

Workaround: Place the initialization of the dialog box in the OnStart method. The OnStart method is called after the OnCreate method, or when the activity transitions from the stop state to the active state.

Unable to add window – token [email protected] is not valid error analysis record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.