Android edittext 在Android EditText中设置long和double值
我想通过适配器列表从JSON中获取一个长值或双倍值,并在Android中将其设置为EditText。如何完成这项工作?如果您使用的是JSONObject类,则可以使用Android edittext 在Android EditText中设置long和double值,android-edittext,Android Edittext,我想通过适配器列表从JSON中获取一个长值或双倍值,并在Android中将其设置为EditText。如何完成这项工作?如果您使用的是JSONObject类,则可以使用 try { long l = object.getLong(key); // throws exception if there's no long at that key } catch(JSONException json) {} 或 那就做吧 editText.setText("" + l); editText
try {
long l = object.getLong(key); // throws exception if there's no long at that key
}
catch(JSONException json) {}
或
那就做吧
editText.setText("" + l);
editText.setText("" + l);