小编Sya*_*mic的帖子

从编辑文本中获取信息时的Android编号格式异常

在这里,我从用户那里采取了粗鲁和粗俗,然后我将其转换为整数,这里是日志猫消息的问题:

无法将30.01转换为int!然后我在数据库中输入lat和lon到我的表中:

  public class newMission extends Activity 
  implements OnClickListener{
SQLiteDatabase sql;
EditText e1,e2,e3,e4;
Button b;
MaptoDo obj;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    Intent in =getIntent();
    setContentView(R.layout.newmission);
    e1=(EditText) findViewById(R.id.edn1);
    e2=(EditText) findViewById(R.id.edn2);
    e3=(EditText) findViewById(R.id.edn3);
    e4=(EditText) findViewById(R.id.edn4);
    b=(Button) findViewById(R.id.btnew);
    b.setOnClickListener(this);
    obj=new MaptoDo();
    sql=openOrCreateDatabase("db",0, null);
    sql.execSQL("CREATE TABLE Mission" +
            "" +
            " (emp integer REFERENCES Employee2 (password)," +
            "oper_n text,cust_n text,lat double," +
            "long double,oper_id integer PRIMARY KEY AUTOINCREMENT)");
}
@Override
public void onClick(View v) {
    // …
Run Code Online (Sandbox Code Playgroud)

android google-maps exception numberformatexception android-edittext

-2
推荐指数
1
解决办法
357
查看次数