背景:
阅读新闻
Android 保存进度对话框
[日期:2011-09-04] 来源:Linux社区 作者:hgl868 [字体:]
保存文件对话框
private ProgressDialog mProgressDialogFlashSave = null;//保存flash进度条
private int mProgressCount = 0; //保存进度/*
* 保存多媒体文件
*/
private void media_Save()
{
mProgressDialogFlashSave = new ProgressDialog( this );
mProgressDialogFlashSave.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialogFlashSave.setTitle("flash保存");
mProgressDialogFlashSave.setMessage("Falsh保存中,请稍候...");
mProgressDialogFlashSave.setIcon(R.drawable.byone_logo);
mProgressDialogFlashSave.setProgress(100);
mProgressDialogFlashSave.setIndeterminate( false );
mProgressDialogFlashSave.setCancelable(true);
// mProgressDialogFlashSave.setOnCancelListener(new DialogInterface.OnCancelListener()
// {
// public void onCancel(DialogInterface dialog) {
// //Log.i("MobileMain", "Cancel Called");
// mbSaveFalsh =false;
// mMobileView.flashSaveCancel();
// mProgressDialogFlashSave.cancel();
// }
// });
mProgressDialogFlashSave.show();
}
private Handler mHandlerFlashSave = new Handler()
{
public void handleMessage(Message msg)
{
mProgressCount = msg.what;
if( mProgressCount > 100 )
{
mbSaveFalsh =false;
mProgressDialogFlashSave.cancel();
}
else
{
mProgressDialogFlashSave.setProgress( mProgressCount );
}
super.handleMessage(msg);
}
};
public void handleMsgProgress( int proCount )
{
Message msg= new Message();
msg.what = proCount;
mHandlerFlashSave.sendMessage(msg);
}
相关资讯 Android开发
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯