Android Open Source - open-radiobrony Stop Button

From Project

Back to project page open-radiobrony.


The source code is released under:

Apache License

If you think the Android project open-radiobrony listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.lesikapk.openradiobrony;
//w ww .j a  va  2 s . c om
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.Button;
import android.widget.Toast;

public class StopButton extends Button implements OnClickListener, OnLongClickListener {

  private static StopButton mThis;
    public StopButton(final Context context, final AttributeSet attrs) {
        super(context, attrs);
        mThis = this;

    public void onClick(final View v) {
    if(PlayerActivity.isPrepared()) {

    public boolean onLongClick(final View view) {
        Toast.makeText(getContext(), "Press this button to stop the stream.", Toast.LENGTH_SHORT).show();
        return true;
    public static StopButton getThis() {
      return mThis;

Java Source Code List