`
ggyyleo
  • 浏览: 46834 次
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

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;
	}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics