首页上一页 1  下一页尾页 3 条记录 1/1页
        android自学视频教程里面16.1实例问题
                 	
                        发表在Android图书答疑
                        2015-02-10                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                           public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button1 = (Button) findViewById(R.id.button1); // 获取播放按钮
final Button button2 = (Button) findViewById(R.id.button2); // 获取“暂停/继续”按钮
final Button button3 = (Button) findViewById(R.id.button3); // 获取“停止”按钮
hint = (TextView) findViewById(R.id.hint); // 获取用户显示提示信息的文本框
[font color=#FF0000]file = new File("file:///mnt/media_rw/sdcard/Good_Time.mp3")[/font]; // 获取要播放的文件
if (file.exists()) { // 如果文件存在
player = MediaPlayer
.create(this, Uri.parse(file.getAbsolutePath())); // 创建MediaPlayer对象
} else {
hint.setText("要播放的音频文件不存在!");
button1.setEnabled(false);
return;
}
我把路径都改了怎么还是找不到文件呢
                
        	
        
        
    super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button1 = (Button) findViewById(R.id.button1); // 获取播放按钮
final Button button2 = (Button) findViewById(R.id.button2); // 获取“暂停/继续”按钮
final Button button3 = (Button) findViewById(R.id.button3); // 获取“停止”按钮
hint = (TextView) findViewById(R.id.hint); // 获取用户显示提示信息的文本框
[font color=#FF0000]file = new File("file:///mnt/media_rw/sdcard/Good_Time.mp3")[/font]; // 获取要播放的文件
if (file.exists()) { // 如果文件存在
player = MediaPlayer
.create(this, Uri.parse(file.getAbsolutePath())); // 创建MediaPlayer对象
} else {
hint.setText("要播放的音频文件不存在!");
button1.setEnabled(false);
return;
}
我把路径都改了怎么还是找不到文件呢

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
                    
 
               			  
                







 
                     
                     
					 
						 
						 
						 
						