android - What to put in the single tap confirmed method so that a specific view does a specific job on tap -


what put in single tap confirmed method specific view specific job on tap? have imageviews in layout , want on single tap each imageview specific job. can tell me amethod has it.

` public boolean onsingletapconfirmed(motionevent e){ toast.maketext(creaacount_5.this, "single tap", toast.length_short).show(); edittext b=(edittext)findviewbyid(r.id.edittext1); b.append("*");

             switch(id){                  case 0:                      id=r.id.imageview1;                     toast.maketext(creaacount_5.this, "play", toast.length_short).show();                      sharedpreferences s1=getsharedpreferences(mypreferences,mode_private);                        sharedpreferences.editor editor1=s1.edit();                        editor1.putint("play", r.drawable.playing);                        editor1.commit();                         break;                 case 1:                            id=r.id.imageview3;                      toast.maketext(creaacount_5.this,"think",toast.length_short).show();                        sharedpreferences s2=getsharedpreferences(mypreferences,mode_private);                        sharedpreferences.editor editor2=s2.edit();                        editor2.putint("thinking", r.drawable.think);                        editor2.commit();                       break;                  case 2:                     id=r.id.imageview4;                     sharedpreferences s3=getsharedpreferences(mypreferences,mode_private);                        sharedpreferences.editor editor3=s3.edit();                        editor3.putint("eating", r.drawable.eat);                         editor3.commit();                   break;                  }              return true;            } ` 


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -