Android error-error: Found text "where item tag is expected

Source: Internet
Author: User

Error: Found text "" Where item tag is expected

If you create a file by yourself, write <string name = "key"> value </string> and copy the file to strings. XML, or copy and paste from other documents, the above question may appear, very disgusting

This error is caused by incorrect space format.

Solution:

1. Copy the <string name = "key"> value </string> tag in the eclipse editor and enter value in it.

2. Delete spaces. After the copy, press the delete key of each row to return to the end of the previous row, press enter to make it automatically, and then delete invalid spaces.

The following solutions are also available on the Internet. To solve this problem, we recommend that you: 1. Check whether unnecessary spaces exist and delete them if any. If not, copy and paste the document again. Try not to use different document formats. If not, then 3; 3. replace all the whitespace in the XML document with the space you manually typed out. If not, 4; 4. manually edit it again. For this type of errors, you can use MS Word or Excel to call the document to see if the space format is incorrect.

Note: similar errors (empty lattice errors in XML documents) will also appear in R. Java in the gen folder.
Syntax Error on tokens, delete these tokens
. The above method can solve this problem.Activity has leaked window that was originally addedScenario: when processing time-consuming operations in an application, such as network operations, the thread + handler or asynctask provided by Android is used to improve the user experience, generally, the display progress is customized for dialog or progressdialog. This exception often occurs in this scenario: a foreigner's explanation: views have a reference to their parent context (taken from constructor argument ). if you leave an activity without destroying dialogs and other dynamically created views, they still hold this reference to your activity (if you createdthisAs context: Likenew ProgressDialog(this)), So it cannot be collected by the GC, causing a memory leak. the main reason is that there is a window handle leakage. When the activity is destroyed, a phonewindow (DIALOG) view does not destroy the reference of the context in which it belongs (obtained through the parameters of the constructor ), when you exit the activity, the dynamically created view (such as dialog) is not closed, and it will always have context references, so it cannot be recycled by GC, resulting in Memory leakage. It is easy to understand the cause, and we can release resources in the ondestroy () method of activity. The following is my solution in this case, and other controls are similar. Solution:

@ Override
Protected void ondestroy (){
If (refreshpd! = NULL)
{
Refreshpd. Dismiss ();
}
Super. ondestroy ();
}

Related Article

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.