Java. Lang. nullpointerexception

Source: Internet
Author: User

Two days ago, I had to hand in a small Android item. I wanted to display a list of information from the previous activity on the new activity, but I had not adjusted the bug when I handed in the item, java. lang. nullpointerexception. I had to cancel this function. then I looked back and found that I was mentally retarded and made a mistake. before I jumped from activity A to Activity B, the data was filled into the bundle structure, but the intent was not written. add (bundle ).... the receiving page also lacks a mechanism to handle exceptions. Before obtaining data, it does not determine whether the bundle is null. so that when the error is found, if it is not a line of careful reading of your code,
The specific location of the error cannot be found from a simple error.

Just a few days later, I am still not familiar with Android. In the future, I will avoid such mentally retarded errors.

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.