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.
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); setOnClickListener(this); setOnLongClickListener(this); mThis = this; } @Override public void onClick(final View v) { if(PlayerActivity.isPrepared()) { PlayerActivity.getThis().stopPlaying(); } } @Override 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; } }