Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with listeners #47

Open
suman-tms opened this issue Jan 26, 2017 · 2 comments
Open

Problem with listeners #47

suman-tms opened this issue Jan 26, 2017 · 2 comments

Comments

@suman-tms
Copy link

When i add some code after listener the radio wont play. Like when i try to do something like add a toast messge inside onMetaDataReceived. The app doesnt play anything and when i remove it. It works fine. Can someone help me.

public class MainActivity extends Activity implements RadioListener
...
@OverRide
public void onRadioStarted() {

}

@Override
public void onRadioStopped() {

}

@Override
public void onMetaDataReceived(String s, String s1) {

}
@anaszakariyah
Copy link

anaszakariyah commented May 1, 2017

The radio seems to break whenever you try to do anything with View inside the listener. I don't know why. Updating variable is ok, but doing changes on your view will break it.
EDIT: maybe the listener cannot run on ui thread..

@willsazon
Copy link

This is how it was here.

   **@Override
    public void onRadioStarted() {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {

                nomeMusica.setText("Reproduzindo Áudio...");
                findViewById(R.id.iv_player).setBackgroundResource(R.drawable.action_pause);
            }
        });
    }**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants