---
title: "sadasd"
author: "ggyyleo"
date: "2010-06-04T16:20:41Z"
tags: []
categories: ["编程语言"]
slug: "sadasd"
draft: false
lastmod: "2010-06-04T16:20:41Z"
id: 684197
url: "https://ggyyleo.iteye.com/blog/684197"
---

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

```