视频播放器的更新模块

TV首页main.java弹出updateMange.javad的对话框

main.java:

up = new UpdateManager(MainActivity.this, hander);

updateMange.javad:

   public UpdateManager(Context context,Handler updateHander) {  
        super();  
        this.mContext = context; 
        this.updateHanderOk = updateHander;
        hander = new myHandler();
    }  
      
      
    private void showNoticeDialog() {  
        // TODO Auto-generated method stub 
    	updateHanderOk.sendEmptyMessage(101);
        //构造对话框  
        AlertDialog.Builder builder = new Builder(mContext); 

		if(mHashMap.get("details")!=null||mHashMap.get("details").equals("")){
			detail+=mContext.getResources().getString(R.string.soft_update_detail)+"\n";
			String str[]=mHashMap.get("details").split(";");		
			for(int i=0;i<str.length;i++){
				detail+=String.valueOf(i+1)+")"+str[i]+"\n";
			}
		}
        
        builder.setTitle(R.string.soft_update_title);  
        builder.setMessage(mContext.getResources().getString(R.string.soft_update_info)+"\n"+detail);  
        //更新  
        builder.setPositiveButton(R.string.soft_update_updatebtn, new OnClickListener() {  
              
            @Override  
            public void onClick(DialogInterface dialog, int which) {  
                // TODO Auto-generated method stub  
                dialog.dismiss();  
                // 显示下载对话框  
                showDownloadDialog();  
            }  
        });  
        // 稍后更新  
        builder.setNegativeButton(R.string.soft_update_later, new OnClickListener() {  
              
            @Override  
            public void onClick(DialogInterface dialog, int which) {  
                // TODO Auto-generated method stub 
            	updateHanderOk.sendEmptyMessage(100);
                dialog.dismiss();  
            }  
        });  
        Dialog noticeDialog = builder.create();  
        Log.v("daming.zou**showdialog**", "begin");
        noticeDialog.show();  
    }  


你可能感兴趣的:(视频播放器的更新模块)