码迷,mamicode.com
首页 > 其他好文 > 详细

Mars的mp3实例

时间:2015-08-25 23:13:52      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

Mars的mp3实例第一课:

关于menu:

package mars.mp3player01;

import mars.down.HttpDownloader;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class Mp3ListActivity extends ListActivity{
	private static final int UPDATE = 3;
	private static final int ABOUT = 4;
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		menu.add(0, 3, 1, R.string.mp3list_update);
		menu.add(0, 4 , 2,R.string.mp3list_about);
		return super.onCreateOptionsMenu(menu);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		System.out.println("id:"+item.getItemId());
//		Intent intent01 = new Intent(this, MainActivity.class);
//		intent01.s
		
		switch (item.getItemId()) {
		case UPDATE:
			Mytoast("您选择了更新按钮");
			//用户点击了更新列表按钮
			
			break;

		case ABOUT:
			
			Mytoast("您选择了更新关于");
			//用户点击了关于按钮
			break;
		}
		return super.onOptionsItemSelected(item);
	}
	
	private void Mytoast(String message){
		Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
	}
	
	private String downloadXML(){
		HttpDownloader httpdownload = new HttpDownloader();
		httpdownload.dow
		
		return null;
	}
	
}

  

Mars的mp3实例

标签:

原文地址:http://www.cnblogs.com/Sunnor/p/4758813.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!