本文整理汇总了Java中android.app.ProgressDialog.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressDialog.setIcon方法的具体用法?Java ProgressDialog.setIcon怎么用?Java ProgressDialog.setIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.setIcon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
wakeLock.acquire();
progressDialog = new ProgressDialog(context);
progressDialog.setIcon(R.mipmap.ic_launcher);
progressDialog.setTitle(R.string.app_name);
progressDialog.setMessage(context.getString(R.string.msg_downloading, url.toString()));
progressDialog.setIndeterminate(true);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(true);
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
DownloadTask.this.cancel(true);
}
});
progressDialog.show();
}
示例2: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
String title ="";
int icon=-1 ;
icon= R.drawable.filetype_video;
ProgressDialog pd = new ProgressDialog(getActivity());
pd.setTitle(title);
if(icon >=0)
pd.setIcon(icon);
pd.setMessage(getText(R.string.deleting));
pd.setIndeterminate(true);
pd.setCancelable(true);
return pd;
}
示例3: showProgressDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
public static void showProgressDialog(Context context) {
dialog = new ProgressDialog(context);
dialog.setIcon(R.mipmap.ic_launcher);
dialog.setTitle(R.string.app_name);
dialog.setMessage("请等候,数据加载中……");
dialog.show();
}
示例4: onCreateDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
ProgressDialog pd = new ProgressDialog(getActivity());
pd.setTitle(mCurrentDirectory.getLastPathSegment());
pd.setIcon(R.drawable.filetype_video_folder);
pd.setMessage(getText(R.string.loading));
pd.setIndeterminate(true);
pd.setCancelable(true);
return pd;
}
示例5: showDownloadDialog
import android.app.ProgressDialog; //导入方法依赖的package包/类
/**
* 弹出下载对话框
*/
public void showDownloadDialog() {
mDownloadDialog = new ProgressDialog(mContext);
mDownloadDialog.setIcon(R.mipmap.ic_launcher);
mDownloadDialog.setTitle("版本更新");
mDownloadDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mDownloadDialog.setMessage("正在玩命下载中......");
mDownloadDialog.getWindow().setGravity(Gravity.CENTER);
mDownloadDialog.setMax(100);
mDownloadDialog.show();
}
示例6: onPreExecute
import android.app.ProgressDialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
PreventActivity pa = wr.get();
if (pa != null) {
dialog = new ProgressDialog(pa);
dialog.setTitle(R.string.app_name);
dialog.setIcon(R.drawable.ic_launcher);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setCancelable(false);
dialog.setMax(mAdapter.getSize());
dialog.show();
labelLoader = new LabelLoader(pa);
}
}