小编bin*_*dal的帖子

无法解析java.lang.NumberFormat异常

try{    
    if (flag_conv == false)
    {
      if ((Integer.parseInt(et1.getText().toString()))<=55)
      {
       final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
       alertDialog.setTitle("Reset...");
       alertDialog.setMessage("WB should be grater than 55");

       alertDialog.setButton2("OK", new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) 
          {
                // here you can add functions
                dialog.dismiss();
          }});
       alertDialog.setIcon(R.drawable.icon);
       alertDialog.show();
       tv1.setText("WB");
       et1.setText("");
       wbflg = true;
       wbval = 0;
       return;          
     }
     else
     {                     
      wbval = Integer.parseInt(et1.getText().toString());
     }
   }
 catch(NumberFormatException nfe)
{System.out.println("Could not parse " + nfe);}
Run Code Online (Sandbox Code Playgroud)

我得到以下例外

07-31 14:48:45.409: INFO/System.out(431): Could not parse java.lang.NumberFormatException: unable to parse '' …
Run Code Online (Sandbox Code Playgroud)

int parsing android

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

int ×1

parsing ×1