java - EditText equals -


i have search app has 150 files. if searches 151, "the file 151 can't found".

i have code:

edittext edit = (edittext) findviewbyid(r.id.edittext1);  if (edit.gettext().tostring().equals("151")) {     edit.seterror("invalid file name"); } else {     // nothing; } 

but have 2 questions:

  1. how can set .equals("151") like: .equals("151" >) (151 , up)?
  2. what code of: "do nothing"?

  1. you create int string. this:

    int aint = integer.parseint(edit.gettext().tostring());  if(aint > 150) dostuff(); 
  2. to nothing, add ";".

    if(foo) dostuff(); else ; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -