码迷,mamicode.com
首页 > 移动开发 > 详细

android popupwindow低版本报空指针

时间:2015-01-01 11:11:57      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

在项目中使用Popupwindow pop=new?Popupwindow();在2.3版本报

异常信息: Exception: null 堆栈信息: 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.Looper.loop(Looper.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)

只需使用?Popupwindow pop=new?Popupwindow(Context); 方法替换即可

android popupwindow低版本报空指针

标签:

原文地址:http://www.cnblogs.com/foreverstudent/p/4197069.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!