sadasd

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;
	}
}

你可能感兴趣的:(android,OS)