org.json.JSONException: Unterminated array at character 1858 of json字符串。我遇到这个Exception的时候是因为缺少一个逗号(,)。
java.net.SocketException: No route to host原因是我手机连接的无线与SocketServer连接的无线不同。导致手机的IP与SocketServer服务器端的IP不在同一路由器上。把手机重新连接SocketServer的网络之后,就不会报这异常了。网上有的说模拟器不会报错的原因就是因为模拟器的IP和SocketServer的Ip是在同一个路由器中。
异常3:
ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.zyq.main/.CropImage } from null (pid=6849, uid=2000) requires null
或
warn1:
Permission denied: checkComponentPermission() reqUid=10111 Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.zyq.main/.CropImage } from null (pid=3387, uid=2000) requires null
异常4
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application这个异常出现在new AlertDialog.Builder(mContext)这句代码中,这里的mContext不能使用 getApplicationContext()获得的Context,而必须使用Activity,因为只有一个Activity才能添加一个窗体。