[Android development experience] The NULL pointer of the init method of PopupWindow in earlier versions is abnormal. androidpopupwindow

Source: Internet
Author: User

[Android development experience] The NULL pointer of the init method of PopupWindow in earlier versions is abnormal. androidpopupwindow

Yesterday, the tester submitted a BUG to me. In Version 2.3, when popupwindow is popped up, there will be a null pointer exception. In the high version, there is no problem, the following error message is displayed. (the exception is the same as the one found. My exception has been resolved)

Exception information: Exception: null stack information: android. widget. popupWindow. setContentView (PopupWindow. java: 384) android. widget. popupWindow. <init> (PopupWindow. java: 286) android. widget. popupWindow. <init> (PopupWindow. java: 266) android. widget. popupWindow. <init> (PopupWindow. java: 223) net. oschina. gitapp. widget. dropDownMenu. <init> (DropDownMenu. java: 34) net. oschina. gitapp. ui. projectActivity. initMoreMenu (ProjectActivity. java: 255) net. oschina. gitapp. ui. projectActivity. access $10 (ProjectActivity. java: 254) net. oschina. gitapp. ui. projectActivity $3. onPostExecute (ProjectActivity. java: 385) net. oschina. gitapp. ui. projectActivity $3. onPostExecute (ProjectActivity. java: 1) android. OS. asyncTask. finish (AsyncTask. java: 417) android. OS. asyncTask. access $300 (AsyncTask. java: 127) android. OS. asyncTask $ InternalHandler. handleMessage (AsyncTask. java: 429) android. OS. handler. dispatchMessage (Handler. java: 99) android. OS. logoff. loop (logoff. java: 130) android. app. activityThread. main (ActivityThread. java: 3691) java. lang. reflect. method. invokeNative (Native Method) java. lang. reflect. method. invoke (Method. java: 507) com. android. internal. OS. zygoteInit $ MethodAndArgsCaller. run (ZygoteInit. java: 912) com. android. internal. OS. zygoteInit. main (ZygoteInit. java: 670) dalvik. system. nativeStart. main (Native Method)

This is because super (context) is not called in the constructor. You only need to call super (context) In the first line of the constructor.

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.