Android Fool small Error

Source: Internet
Author: User

The error of the report is not the same as the original exception, can only read the Oom memory overflow, error code as follows:

Private voidgetpersons () {String path= "Content://com.lss.readcontactmassage.persondbprovider/query"; Uri URI=uri.parse (path); Contentresolver Contentresolver=Getcontentresolver (); Cursor Cursor= Contentresolver.query (URI,NULL,NULL,NULL,NULL); Persons=NewArraylist<person>(); if(cursor==NULL){            return; }         while(cursor.movetolast ()) {intid = cursor.getint (cursor.getcolumnindex ("id"))); String name= Cursor.getstring (Cursor.getcolumnindex ("name")); String Number= Cursor.getstring (Cursor.getcolumnindex ("number")); Person Person=NewPerson (ID, name, number);        Persons.add (person);    } cursor.close (); }

While constitutes a dead loop, so the memory overflow, this unusual error encountered when not panic, learn to use debug, break point to find errors.

Android Fool small Error

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.