• java.lang.NullPointerException 错误处理


    04-07 15:26:52.784: E/AndroidRuntime(19878): FATAL EXCEPTION: main
    04-07 15:26:52.784: E/AndroidRuntime(19878): Process: com.anzi.jmsht, PID: 19878
    04-07 15:26:52.784: E/AndroidRuntime(19878): java.lang.NullPointerException
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at com.anzi.jmsht.adpater.AppListViewAdapter$2.onClick(AppListViewAdapter.java:575)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.view.View.performClick(View.java:4505)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.view.View$PerformClick.run(View.java:18898)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.os.Handler.handleCallback(Handler.java:808)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.os.Handler.dispatchMessage(Handler.java:103)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.os.Looper.loop(Looper.java:193)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at android.app.ActivityThread.main(ActivityThread.java:5499)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at java.lang.reflect.Method.invokeNative(Native Method)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at java.lang.reflect.Method.invoke(Method.java:515)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:654)
    04-07 15:26:52.784: E/AndroidRuntime(19878):  at dalvik.system.NativeStart.main(Native Method)

    com.anzi.jmsht.adpater.AppListViewAdapter$2.onClick(AppListViewAdapter.java:575)中的代码:

    -->574       startAPP((String) model.getItem("appackage"));

    -->575       dialog.cancel();

    解决办法:

    -->574      startAPP((String) model.getItem("appackage"));
    -->575             if(dialog!=null){
    -->576                 dialog.cancel();
    -->577                   }

  • 相关阅读:
    Maven安装
    (字符串哈希表)找到字符串中不重复出现字符的最长子串长度
    (动态规划)给定三角形,找到从上到下的最小路径总和
    (链表)删除链表的重复元素
    (树)判断二叉树是否为BST
    (动态规划)机器人走迷宫问题
    (数组)Largest Rectangle in Histogram(栈解问题)
    (树)每一层节点的右指针问题(层次遍历)
    (字符串)count and say
    (贪心)加油站绕圈问题
  • 原文地址:https://www.cnblogs.com/childhooding/p/4398470.html
Copyright © 2020-2023  润新知