Não, compila normal. Quando começa a carregar pra simular no AVD é que trava. se eu tirar fora somente essa parte, carrega sem travar...
Cláudio
2014-03-06 8:29 GMT-03:00 Rodrigo Piovezan <piovezan@gmail.com>:
"Trava" no seu caso quer dizer "não permite compilar", certo?Como está o import que traz a classe OnTouchListener ?--On Thu, Mar 6, 2014 at 3:13 AM, Claudio <listas.arquivo@gmail.com> wrote:--Olá.Tenho uma activity (MainActivity) que contém um background e uma imageview, ela está vinculada uma main.xml.Quero mudar a cor da imageview ao pressiona-la, estou tentando implementar usando o OnTouchListener, porem quando coloco o codigo abaixo trava.Sem ele carrega normal, quando coloco ele trava.Ele está dentro do método Oncreate e dá um erro:Multiple markers at this line- implements android.view.View.OnTouchListener.onTouch- The method onTouch(View, MotionEvent) of type new View.OnTouchListener(){} must override a superclassmethodSe eu retiro o @Override o erro desaparece, mas como falei trava ao carregar a view. Alguma dica ?Obrigado.ImageView connect = (ImageView) findViewById(R.drawable.connect);
connect.setOnTouchListener(new OnTouchListener() {@Overridepublic boolean onTouch(View v, MotionEvent event) {switch (event.getAction()) {case MotionEvent.ACTION_DOWN: {ImageView view = (ImageView) v;view.getDrawable().setColorFilter(0x77000000,Mode.MULTIPLY);view.invalidate();break;}case MotionEvent.ACTION_UP:case MotionEvent.ACTION_CANCEL: {ImageView view = (ImageView) v;view.getDrawable().clearColorFilter();view.invalidate();break;}}return true;}});
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário