Caused by: java.lang.NumberFormatException: Invalid double: “” with blank value

后端 未结 2 961
囚心锁ツ
囚心锁ツ 2021-01-28 02:59

I get ther error when JSON string have some blank value, getting from server, how to deal with blank values here is JSON

{  
   \"status\":\"succes         


        
2条回答
  •  一生所求
    2021-01-28 03:35

    Change the type of image_width and image_height to String in MyData Class

    public String image_width;
    
    public String image_height;
    

    As int will not be able to store "" this string, and at the time of using it you can parse it into int.

提交回复
热议问题