Unable to start activity ComponentInfo {com. first/com. first. Game}, unabletostartgame

Source: Internet
Author: User

Unable to start activity ComponentInfo {com. first/com. first. Game}, unabletostartgame
Cause 1: xxx error. If it is R. layout. main should be main. tag usage errors in xml files. The most common errors that are not prompted by the compiler are the confusion between android: name and android: id. Check the main. all labels in xml are correct. Cause 2: The requestWindowFeature () method is used after the setContentView (view) method. If this error is returned, the requestFeature must be used before setContentView, you only need to put the requestWindowFeature () method before the setContentView (view) method. cause 3: In addition to the onCreate () method, the findById (R. id. xx), You Need To findById (R. id. xx) to solve the problem. 4. The view is not instantiated before setContentView (view). It is only declared and directly setContentView (view). Check whether the view is setContentView (view) cause 5 can be solved by instantiation in the method before calling: because of a null pointer error, you should check whether there is a value in something like a Spinner or list.

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.