Toshi depois que voc captura o evento e trata o metodo deve retorna true para que o evento não propague, pode ser isso.
Abs
Em terça-feira, 22 de julho de 2014 15h24min56s UTC-3, Toshi Ossada escreveu:
-- Abs
Em terça-feira, 22 de julho de 2014 15h24min56s UTC-3, Toshi Ossada escreveu:
Blz, qnd chegar em ksa eu mando, mas acho q isso é configuração do android, pq quando deixo ele pressionado ele abre o google nowEm 22 de julho de 2014 14:05, Marcos Vinithius Melo Filho <marcos.v...@gmail.com> escreveu:
Vçw Carlos Eduardo!!!Em 21 de julho de 2014 15:04, Carlos Eduardo <carlosedua...@gmail.com > escreveu:
Volume por onKeyDown tranquilamente.@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) ;if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP);}
--
Carlos Eduardo Simões PelegrinEm 21 de julho de 2014 14:31, Marcos Vinithius Melo Filho <marcos.v...@gmail.com> escreveu:
E os botões de volume??? Alguém sabe manipular? Tipo... dar outra função neles?Em 21 de julho de 2014 14:00, Carlos Eduardo <carlosedua...@gmail.com > escreveu:
Eu n consegui pelo onkeydown.Se conseguir posta aí!
--
Carlos Eduardo Simões PelegrinEm 21 de julho de 2014 13:00, Jhonatas Martins dos Santos <jhonat...@gmail.com> escreveu:Isso.
Se você quiser saber os eventos dos botões enquanto a app estiver em background voc irá precisar, caso não precise o onKeyDown resolve
Em segunda-feira, 21 de julho de 2014 11h56min46s UTC-3, Toshi Ossada escreveu:Isso no KeyDown da Activity??? Mas dai eu vou ainda precisar daquele lance do Manifest? e da classe RemoteControlReceiver?<receiverandroid:name=".RemoteControlReceiver" android:priority="1000" ><intent-filter><action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter></receiver>Em 21 de julho de 2014 09:01, Jhonatas Martins dos Santos <jhonat...@gmail.com> escreveu:
Mandei sem querer.
Mas compara o keycode com o keycode de media como KEYCODE_MEDIA_PLAY
e ver se dá certo
Abs
Em segunda-feira, 21 de julho de 2014 08h59min06s UTC-3, Jhonatas Martins dos Santos escreveu:Toshi sobreescreve o onKeyDown da activity,
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
}
Em domingo, 20 de julho de 2014 15h32min29s UTC-3, Toshi Ossada escreveu:Vlw Carlos, funcionou mas nao como eu qria, eu qria chamar o método da minha activity principal dentro do 'onClick', tentei implementer como uma inner class, mas nao deu certoEm 18 de julho de 2014 09:30, Toshi Ossada <toshi....@gmail.com> escreveu:Vlw Carlos e Geovani, irei testar assim que puder e falo se deu certo ou nao2014-07-18 8:54 GMT-03:00 Carlos Pelegrin <carlosedua...@gmail.com>:
Tem um BroadcastReceiver específico que é chato de usar.
Depende muito do device e do fone que você utiliza.
veja o exemplo:Classe BR:
public class RemoteControlReceiver extends BroadcastReceiver {private String TAG = "RemoteControlReceiver";@Overridepublic void onReceive(Context context, Intent intent) {Log.e(TAG, "Action: " + intent.getAction());if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT); if (event.getAction() == KeyEvent.ACTION_DOWN) {Log.e(TAG, event.toString());}else if (event.getAction() == KeyEvent.ACTION_UP) {Log.e(TAG, event.toString());}}}}
Manifest:
<receiverandroid:name=".RemoteControlReceiver" android:priority="1000" ><intent-filter><action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter></receiver>
Classe Activity:
((AudioManager) getSystemService(AUDIO_SERVICE)) .registerMediaButtonEventReceiver(new ComponentName( getPackageName(),RemoteControlReceiver.class.getName()));
Foi a única forma que consegui utilizar.Att.Carlos
Em sexta-feira, 18 de julho de 2014 08h23min07s UTC-3, Toshi Ossada escreveu:Bom dia,Estou tentando implementar um evento para quando o usuario pressionar o botão que há junto ao fone de ouvido, aquele que atende chamadas, alguem saberia q evento eu devo usar?[]'s--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--Kevlin Toshinari Ossada
Software Engineer--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--Kevlin Toshinari OssadaSoftware EngineerTelefone: (19) 3406.3005/(19) 9 9120.0273E-mail: toshi....@gmail.com--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--Atenciosamente, Marcos Vinithius--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--Atenciosamente, Marcos Vinithius--
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-...@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--Kevlin Toshinari OssadaSoftware EngineerTelefone: (19) 3406.3005/(19) 9 9120.0273E-mail: toshi....@gmail.com
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/d/optout.
0 comentários:
Postar um comentário