package com.jleo.war3;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class SingleSoundingButton extends Button {
private int soundId;
protected static final String LAST_PLAYED_INFO = "LASTPALYEDINFO";
protected static final String LAST_PLAYED = "LASTPLAYED";
public SingleSoundingButton(Context context) {
super(context);
this.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
Intent intent = new Intent("android.intent.action.DISP_RINGTONE");
Bundle longClickBundle = new Bundle();
longClickBundle.putInt(LAST_PLAYED, soundId);
intent.putExtra(LAST_PLAYED_INFO, longClickBundle);
v.getContext().startActivity(intent);
return true;
}
});
}
public int getSoundId() {
return soundId;
}
public void setSoundId(int soundId) {
this.soundId = soundId;
}
}
sadasd
最新推荐文章于 2022-01-12 22:15:43 发布