Java Code Examples for android.app.ProgressDialog

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project agit, under directory /agit/src/main/java/com/madgag/agit/.

Source file: RepositoryViewerActivity.java

  18 
vote

protected Dialog onCreateDialog(int id){
switch (id) {
case DELETION_IN_PROGRESS_DIALOG:
    ProgressDialog deletionDialog=new ProgressDialog(this);
  deletionDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
deletionDialog.setMessage("Deleting repo...");
deletionDialog.setIndeterminate(true);
return deletionDialog;
case DELETION_CONFIRMATION_DIALOG:
return new AlertDialog.Builder(this).setIcon(R.drawable.icon).setTitle(repo_deletion_dialog_confirmation_title).setMessage(repo_deletion_dialog_confirmation_message).setPositiveButton(button_yes,DELETION_CONFIRMATION_DIALOG_LISTENER).setNegativeButton(button_no,DELETION_CONFIRMATION_DIALOG_LISTENER).create();
default :
return super.onCreateDialog(id);
}
}
 

Example 2

From project AirCastingAndroidClient, under directory /src/main/java/pl/llp/aircasting/activity/task/.

Source file: SimpleProgressTask.java

  18 
vote

public static ProgressDialog prepareDialog(Context context,int progressStyle){
  ProgressDialog progressDialog=new ProgressDialog(context);
  progressDialog.setMessage(context.getString(R.string.working));
  progressDialog.setCancelable(false);
  progressDialog.setProgressStyle(progressStyle);
  return progressDialog;
}
 

Example 3

From project Android-GifStitch, under directory /src/com/phunkosis/gifstitch/dialogs/.

Source file: DialogHelper.java

  18 
vote

public static ProgressDialog getEncodingProgressDialog(final Context c){
  ProgressDialog mProgDiag=new ProgressDialog(c);
  mProgDiag.setMessage(c.getResources().getString(R.string.dialog_encoding_message));
  mProgDiag.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgDiag.setCancelable(false);
  return mProgDiag;
}
 

Example 4

From project android-service-arch, under directory /ServiceFramework/src/ru/evilduck/framework/ui/.

Source file: DemoActivity.java

  18 
vote

@Override protected Dialog onCreateDialog(int id){
  ProgressDialog progressDialog=new ProgressDialog(this);
  progressDialog.setMessage("Processing");
  progressDialog.setCancelable(false);
  return progressDialog;
}
 

Example 5

From project androidquery, under directory /demo/src/com/androidquery/test/async/.

Source file: AjaxLoadingActivity.java

  18 
vote

public void async_progress_dialog(){
  ProgressDialog dialog=new ProgressDialog(this);
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setInverseBackgroundForced(false);
  dialog.setCanceledOnTouchOutside(true);
  dialog.setTitle("Sending...");
  String url="http://www.google.com/uds/GnewsSearch?q=Obama&v=1.0";
  aq.progress(dialog).ajax(url,JSONObject.class,this,"jsonCb");
}
 

Example 6

From project android_aosp_packages_apps_Settings, under directory /src/com/android/settings/.

Source file: ApnSettings.java

  18 
vote

@Override protected Dialog onCreateDialog(int id){
  if (id == DIALOG_RESTORE_DEFAULTAPN) {
    ProgressDialog dialog=new ProgressDialog(this);
    dialog.setMessage(getResources().getString(R.string.restore_default_apn));
    dialog.setCancelable(false);
    return dialog;
  }
  return null;
}
 

Example 7

From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/ui/.

Source file: MenuExecutor.java

  18 
vote

private static ProgressDialog createProgressDialog(Context context,int titleId,int progressMax){
  ProgressDialog dialog=new ProgressDialog(context);
  dialog.setTitle(titleId);
  dialog.setMax(progressMax);
  dialog.setCancelable(false);
  dialog.setIndeterminate(false);
  if (progressMax > 1) {
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  }
  return dialog;
}
 

Example 8

From project android_packages_apps_phone, under directory /src/com/android/phone/.

Source file: EmergencyCallHandler.java

  18 
vote

/** 
 * create the dialog and hand it back to caller.
 */
private ProgressDialog constructDialog(int retryCount){
  int msgId=(retryCount == INITIAL_ATTEMPT) ? R.string.emergency_enable_radio_dialog_message : R.string.emergency_enable_radio_dialog_retry;
  ProgressDialog pd=new ProgressDialog(getApplication());
  pd.setTitle(getText(R.string.emergency_enable_radio_dialog_title));
  pd.setMessage(getText(msgId));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
  pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  pd.show();
  return pd;
}
 

Example 9

From project BusFollower, under directory /src/net/argilo/busfollower/.

Source file: FetchRoutesTask.java

  18 
vote

private ProgressDialog createProgressDialog(){
  ProgressDialog progressDialog=ProgressDialog.show(activityContext,"",applicationContext.getString(R.string.loading),true,true,new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      if (dataFetcher != null) {
        cancel(false);
        dataFetcher.abortRequest();
      }
    }
  }
);
  return progressDialog;
}
 

Example 10

From project connectbot, under directory /src/sk/vx/connectbot/util/.

Source file: TransferThread.java

  18 
vote

private ProgressDialog fileProgressDialog(Activity activity,String message){
  ProgressDialog progress=new ProgressDialog(activity);
  progress.setIndeterminate(true);
  progress.setMessage(message);
  progress.setCancelable(false);
  progress.show();
  return progress;
}
 

Example 11

From project creamed_glacier_app_settings, under directory /src/com/android/settings/.

Source file: ApnSettings.java

  18 
vote

@Override protected Dialog onCreateDialog(int id){
  if (id == DIALOG_RESTORE_DEFAULTAPN) {
    ProgressDialog dialog=new ProgressDialog(this);
    dialog.setMessage(getResources().getString(R.string.restore_default_apn));
    dialog.setCancelable(false);
    return dialog;
  }
  return null;
}
 

Example 12

From project cw-omnibus, under directory /Progress/Dialog/src/com/commonsware/android/progdlg/.

Source file: SampleDialogFragment.java

  18 
vote

@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  ProgressDialog dlg=new ProgressDialog(getActivity());
  dlg.setMessage(getActivity().getString(R.string.dlg_title));
  dlg.setIndeterminate(true);
  dlg.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  return (dlg);
}
 

Example 13

From project dreamDroid, under directory /src/net/reichholf/dreamdroid/fragment/dialogs/.

Source file: SimpleProgressDialog.java

  18 
vote

@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  setRetainInstance(true);
  final ProgressDialog dialog=new ProgressDialog(getActivity());
  dialog.setTitle(mTitle);
  dialog.setMessage(mMessage);
  dialog.setIndeterminate(true);
  dialog.setCancelable(false);
  return dialog;
}
 

Example 14

From project droid-comic-viewer, under directory /src/net/robotmedia/acv/ui/.

Source file: ACVDialogFactory.java

  18 
vote

public ProgressDialog createLoadProgressDialog(){
  ProgressDialog progressDialog;
  progressDialog=new ProgressDialog(viewer);
  progressDialog.setTitle(R.string.dialog_loading_progress_title);
  progressDialog.setIcon(android.R.drawable.ic_menu_info_details);
  progressDialog.setMessage(viewer.getString(R.string.dialog_loading_progress_text));
  progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  return progressDialog;
}
 

Example 15

From project 4308Cirrus, under directory /tendril-cirrus/src/main/java/edu/colorado/cs/cirrus/cirrus/.

Source file: AbstractAsyncTendrilActivity.java

  17 
vote

public void showProgressDialog(CharSequence message){
  if (progressDialog == null) {
    progressDialog=new ProgressDialog(this);
    progressDialog.setIndeterminate(true);
  }
  progressDialog.setMessage(message);
  progressDialog.show();
}
 

Example 16

From project Alerte-voirie-android, under directory /src/com/fabernovel/alertevoirie/.

Source file: HomeActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
switch (id) {
case DIALOG_PROGRESS:
    ProgressDialog pd=new ProgressDialog(this);
  pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setIndeterminate(true);
pd.setOnDismissListener(new OnDismissListener(){
@Override public void onDismiss(DialogInterface dialog){
  if (dialog_shown)   removeDialog(DIALOG_PROGRESS);
}
}
);
pd.setOnCancelListener(new OnCancelListener(){
@Override public void onCancel(DialogInterface dialog){
AVService.getInstance(HomeActivity.this).cancelTask();
finish();
}
}
);
pd.setMessage(getString(R.string.ui_message_loading));
return pd;
default :
return super.onCreateDialog(id);
}
}
 

Example 17

From project andlytics, under directory /src/com/github/andlyticsproject/.

Source file: AdmobAuthenticatorActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
  ProgressDialog dialog=new ProgressDialog(this);
  dialog.setMessage("Authenticating...");
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      if (mAuthThread != null) {
        mAuthThread.interrupt();
        finish();
      }
    }
  }
);
  return dialog;
}
 

Example 18

From project Android, under directory /app/src/main/java/com/github/mobile/ui/.

Source file: LightProgressDialog.java

  17 
vote

/** 
 * Create progress dialog
 * @param context
 * @param message
 * @return dialog
 */
public static AlertDialog create(Context context,CharSequence message){
  if (SDK_INT > FROYO) {
    ProgressDialog dialog;
    if (SDK_INT >= ICE_CREAM_SANDWICH)     dialog=new LightProgressDialog(context,message);
 else {
      dialog=new ProgressDialog(context);
      dialog.setInverseBackgroundForced(true);
    }
    dialog.setMessage(message);
    dialog.setIndeterminate(true);
    dialog.setProgressStyle(STYLE_SPINNER);
    dialog.setIndeterminateDrawable(context.getResources().getDrawable(drawable.spinner));
    return dialog;
  }
 else {
    AlertDialog dialog=LightAlertDialog.create(context);
    dialog.setInverseBackgroundForced(true);
    View view=LayoutInflater.from(context).inflate(layout.progress_dialog,null);
    ((TextView)view.findViewById(id.tv_loading)).setText(message);
    dialog.setView(view);
    return dialog;
  }
}
 

Example 19

From project android-client, under directory /xwiki-android-components/src/org/xwiki/android/components/commenteditor/.

Source file: CommentEditorActivity.java

  17 
vote

private void initDataArray(){
  final ProgressDialog myProgressDialog;
  myProgressDialog=ProgressDialog.show(CommentEditorActivity.this,"Comment","Loading comments...",true);
  Requests request=new Requests(url);
  if (isSecured) {
    request.setAuthentication(username,password);
  }
  Comments comments=request.requestPageComments(wikiName,spaceName,pageName);
  commentList=comments.getComments();
  data=new String[commentList.size()];
  for (int i=0; i < data.length; i++) {
    data[i]=commentList.get(i).getAuthor() + "\n" + commentList.get(i).getText();
  }
  myProgressDialog.dismiss();
}
 

Example 20

From project android-client_1, under directory /src/com/googlecode/asmack/view/.

Source file: AuthenticatorActivity.java

  17 
vote

/** 
 * Create a wait dialog while the login thread is running.
 */
@Override protected Dialog onCreateDialog(int id){
  final ProgressDialog dialog=new ProgressDialog(this);
  dialog.setMessage("Login...");
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      Log.i(TAG,"dialog cancel has been invoked");
      try {
        loginTestThread.interrupt();
        try {
          loginTestThread.join();
        }
 catch (        InterruptedException e) {
        }
      }
  finally {
        finish();
      }
    }
  }
);
  return dialog;
}
 

Example 21

From project android-client_2, under directory /src/org/mifos/androidclient/util/ui/.

Source file: UIUtils.java

  17 
vote

public void displayProgressDialog(String title,String message,boolean cancelable){
  if (mProgressDialog == null) {
    mProgressDialog=new ProgressDialog(mContext);
  }
  if (!mProgressDialog.isShowing()) {
    mProgressDialog.setTitle(title);
    mProgressDialog.setMessage(message);
    mProgressDialog.setCancelable(cancelable);
    mProgressDialog.show();
  }
}
 

Example 22

From project android-joedayz, under directory /Proyectos/AndroidTwitter/src/com/mycompany/android/.

Source file: TwitterApp.java

  17 
vote

public TwitterApp(Context context,String consumerKey,String secretKey){
  this.context=context;
  mTwitter=new TwitterFactory().getInstance();
  mSession=new TwitterSession(context);
  mProgressDlg=new ProgressDialog(context);
  mProgressDlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
  mConsumerKey=consumerKey;
  mSecretKey=secretKey;
  mHttpOauthConsumer=new CommonsHttpOAuthConsumer(mConsumerKey,mSecretKey);
  mHttpOauthprovider=new DefaultOAuthProvider("http://twitter.com/oauth/request_token","http://twitter.com/oauth/access_token","http://twitter.com/oauth/authorize");
  mAccessToken=mSession.getAccessToken();
  configureToken();
}
 

Example 23

From project android-ocr, under directory /android/src/edu/sfsu/cs/orange/ocr/.

Source file: CaptureActivity.java

  17 
vote

void displayProgressDialog(){
  indeterminateDialog=new ProgressDialog(this);
  indeterminateDialog.setTitle("Please wait");
  String ocrEngineModeName=getOcrEngineModeName();
  if (ocrEngineModeName.equals("Both")) {
    indeterminateDialog.setMessage("Performing OCR using Cube and Tesseract...");
  }
 else {
    indeterminateDialog.setMessage("Performing OCR using " + ocrEngineModeName + "...");
  }
  indeterminateDialog.setCancelable(false);
  indeterminateDialog.show();
}
 

Example 24

From project Android-Simple-Social-Sharing, under directory /SimpleSocialSharing/src/com/nostra13/socialsharing/facebook/extpack/com/facebook/android/.

Source file: FbDialog.java

  17 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mSpinner=new ProgressDialog(getContext());
  mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
  mSpinner.setMessage("Loading...");
  mSpinner.setCancelable(false);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  mContent=new FrameLayout(getContext());
  setUpWebView(10);
  addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
}
 

Example 25

From project Android-SyncAdapter-JSON-Server-Example, under directory /src/com/example/android/samplesync/authenticator/.

Source file: AuthenticatorActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
  final ProgressDialog dialog=new ProgressDialog(this);
  dialog.setMessage(getText(R.string.ui_activity_authenticating));
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      Log.i(TAG,"dialog cancel has been invoked");
      if (mAuthThread != null) {
        mAuthThread.interrupt();
        finish();
      }
    }
  }
);
  return dialog;
}
 

Example 26

From project android-tether, under directory /facebook/src/com/facebook/android/.

Source file: FbDialog.java

  17 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mSpinner=new ProgressDialog(getContext());
  mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);
  mSpinner.setMessage("Loading...");
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  mContent=new FrameLayout(getContext());
  createCrossImage();
  int crossWidth=mCrossImage.getDrawable().getIntrinsicWidth();
  setUpWebView(crossWidth / 2);
  mContent.addView(mCrossImage,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  addContentView(mContent,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
}
 

Example 27

From project android-xbmcremote, under directory /src/org/xbmc/android/remote/presentation/activity/.

Source file: HomeActivity.java

  17 
vote

@Override public Dialog onCreateDialog(int id){
  mProgressDialog=new ProgressDialog(this);
  mProgressDialog.setMessage("");
  mProgressDialog.setProgress(0);
  mProgressDialog.setOnCancelListener(new OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      mProgressThread.cancel();
    }
  }
);
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  return mProgressDialog;
}
 

Example 28

From project android-xbmcremote-sandbox, under directory /src/org/xbmc/android/account/authenticator/.

Source file: AuthenticatorActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
  final ProgressDialog dialog=new ProgressDialog(this);
  dialog.setMessage(getText(R.string.addaccount_progress_checkingapiversion));
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      Log.i(TAG,"dialog cancel has been invoked");
      if (mAuthThread != null) {
        mAuthThread.interrupt();
        finish();
      }
    }
  }
);
  return dialog;
}
 

Example 29

From project AndroidLab, under directory /samples/AndroidLdapClient/src/com/unboundid/android/ldap/client/.

Source file: EditServer.java

  17 
vote

/** 
 * Tests the provided server settings to determine if they are acceptable.
 */
private void testSettings(){
  logEnter(LOG_TAG,"testSettings");
  final TestServerThread testThread=new TestServerThread(this,instance);
  testThread.start();
  progressDialog=new ProgressDialog(this);
  progressDialog.setTitle(getString(R.string.edit_server_progress_text));
  progressDialog.setIndeterminate(true);
  progressDialog.setCancelable(false);
  progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  progressDialog.show();
}
 

Example 30

From project android_8, under directory /src/com/defuzeme/gui/.

Source file: Gui.java

  17 
vote

public void showProgress(int content){
  Gui._progress=new ProgressDialog(this._activity);
  Gui._progress.setTitle(null);
  Gui._progress.setMessage(this._activity.getString(content));
  Gui._progress.setCancelable(false);
  Gui._progress.show();
  this.timerDelayRemoveDialog(Settings._TimeOut * 3,Gui._progress);
}
 

Example 31

From project android_packages_apps_cmparts, under directory /src/com/cyanogenmod/cmparts/activities/led/.

Source file: NotificationActivity.java

  17 
vote

private void initApplicationList(){
  final ProgressDialog pbarDialog=ProgressDialog.show(this,getString(R.string.dialog_trackball_loading),getString(R.string.dialog_trackball_packagelist),true,false);
  Thread t=new Thread(){
    public void run(){
      onNewIntent(new Intent());
      parsePackageList();
      populateApplicationList();
      mHandler.post(new Runnable(){
        public void run(){
          pbarDialog.dismiss();
        }
      }
);
    }
  }
;
  t.start();
}
 

Example 32

From project android_packages_apps_FileManager, under directory /src/org/openintents/filemanager/util/.

Source file: ExtractManager.java

  17 
vote

@Override protected void onPreExecute(){
  progressDialog=new ProgressDialog(activity);
  progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  progressDialog.setMessage(activity.getResources().getString(R.string.extracting));
  progressDialog.show();
  progressDialog.setProgress(0);
  isExtracted=0;
}
 

Example 33

From project AnySoftKeyboard, under directory /src/com/anysoftkeyboard/ui/settings/.

Source file: UserWordsEditorAsyncTask.java

  17 
vote

@Override protected void onPreExecute(){
  super.onPreExecute();
  progresDialog=new ProgressDialog(mUserWordsEditorActivity);
  progresDialog.setTitle("");
  progresDialog.setMessage(mUserWordsEditorActivity.getText(R.string.user_dictionary_read_please_wait));
  progresDialog.setCancelable(false);
  progresDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  progresDialog.setOwnerActivity(mUserWordsEditorActivity);
  progresDialog.show();
}
 

Example 34

From project Apertiurm-Androind-app-devlopment, under directory /ApertiumAndroid/src/org/apertium/android/.

Source file: DownloadActivity.java

  17 
vote

private void startDownload(){
  progressDialog=new ProgressDialog(thisActivity);
  progressDialog.setTitle(getString(R.string.downloading) + "\n" + Translator.getTitle(toDownload.getpackageMode()));
  progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  progressDialog.setCancelable(true);
  progressDialog.show();
  FileManager.DownloadRun(toDownload.getJarURL(),AppPreference.TEMP_DIR + "/" + toDownload.getJarFileName(),thisActivity.handler);
}
 

Example 35

From project apg, under directory /src/org/thialfihar/android/apg/ui/widget/.

Source file: SectionView.java

  17 
vote

private void createKey(){
  mProgressDialog=new ProgressDialog(getContext());
  mProgressDialog.setMessage(getContext().getString(R.string.progress_generating));
  mProgressDialog.setCancelable(false);
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  mProgressDialog.show();
  mRunningThread=new Thread(this);
  mRunningThread.start();
}
 

Example 36

From project AsmackService, under directory /src/com/googlecode/asmack/view/.

Source file: AuthenticatorActivity.java

  17 
vote

/** 
 * Create a wait dialog while the login thread is running.
 */
@Override protected Dialog onCreateDialog(int id){
  final ProgressDialog dialog=new ProgressDialog(this);
  dialog.setMessage(getText(R.string.authenticator_activity_try_login));
  dialog.setIndeterminate(true);
  dialog.setCancelable(true);
  dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){
    public void onCancel(    DialogInterface dialog){
      Log.i(TAG,"dialog cancel has been invoked");
      try {
        loginTestThread.interrupt();
        try {
          loginTestThread.join();
        }
 catch (        InterruptedException e) {
        }
      }
  finally {
        finish();
      }
    }
  }
);
  return dialog;
}
 

Example 37

From project beintoo-android-sdk, under directory /BeintooSDK/src/com/beintoo/activities/.

Source file: MessagesRead.java

  17 
vote

private void deleteMessage(){
  final ProgressDialog dialog=ProgressDialog.show(getContext(),"",getContext().getString(R.string.messagedeleting),true);
  new Thread(new Runnable(){
    public void run(){
      try {
        Player p=JSONconverter.playerJsonToObject(PreferencesHandler.getString("currentPlayer",getContext()));
        BeintooMessages bm=new BeintooMessages();
        bm.markAsArchived(message.getId(),p.getUser().getId());
        UIhandler.sendEmptyMessage(0);
      }
 catch (      Exception e) {
        e.printStackTrace();
        dialog.dismiss();
      }
      dialog.dismiss();
    }
  }
).start();
}
 

Example 38

From project BF3-Battlelog, under directory /src/com/ninetwozero/battlelog/activity/forum/.

Source file: BoardFragment.java

  17 
vote

@Override protected void onPreExecute(){
  if (context != null) {
    progressDialog=new ProgressDialog(this.context);
    progressDialog.setTitle(R.string.general_wait);
    progressDialog.setMessage("Downloading the forums...");
    progressDialog.show();
  }
}
 

Example 39

From project BibleQuote-for-Android, under directory /src/com/BibleQuote/managers/.

Source file: AsyncTaskManager.java

  17 
vote

private void setupProgressDialog(Context context,OnTaskCompleteListener taskCompleteListener){
  mProgressDialog=new ProgressDialog(context);
  mProgressDialog.setIndeterminate(true);
  mProgressDialog.setCancelable(true);
  mProgressDialog.setOnCancelListener(this);
}
 

Example 40

From project COSsettings, under directory /src/com/cyanogenmod/cmparts/activities/led/.

Source file: NotificationActivity.java

  17 
vote

private void initApplicationList(){
  final ProgressDialog pbarDialog=ProgressDialog.show(this,getString(R.string.dialog_trackball_loading),getString(R.string.dialog_trackball_packagelist),true,false);
  Thread t=new Thread(){
    public void run(){
      onNewIntent(new Intent());
      parsePackageList();
      populateApplicationList();
      mHandler.post(new Runnable(){
        public void run(){
          pbarDialog.dismiss();
        }
      }
);
    }
  }
;
  t.start();
}
 

Example 41

From project Cura, under directory /src/com/cura/.

Source file: CuraActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
switch (id) {
case WAIT:
    loader=new ProgressDialog(this);
  loader.setMessage(loader_message);
loader.setCancelable(false);
return loader;
}
return super.onCreateDialog(id);
}
 

Example 42

From project daily-money, under directory /dailymoney/src/com/bottleworks/commons/util/.

Source file: GUIs.java

  17 
vote

static public void doBusy(Context context,String msg,Runnable r){
  final ProgressDialog dlg=ProgressDialog.show(context,null,msg,true,false);
  if (context instanceof Activity) {
    lockOrientation((Activity)context);
  }
  final BusyRunnable br=new BusyRunnable(context,dlg,r);
  singleExecutor.submit(br);
  guiHandler.post(new Runnable(){
    @Override public void run(){
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
      }
synchronized (br) {
        if (!br.finish) {
          dlg.show();
        }
      }
    }
  }
);
}
 

Example 43

From project danbo, under directory /src/us/donmai/danbooru/danbo/activity/.

Source file: PostListActivity.java

  17 
vote

public GetPostListTask(){
  Resources res=getResources();
  _progressDialog=new ProgressDialog(PostListActivity.this);
  _progressDialog.setIndeterminate(false);
  _progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  _progressDialog.setMessage(res.getString(R.string.generic_loading));
}
 

Example 44

From project DeliciousDroid, under directory /src/com/deliciousdroid/activity/.

Source file: BrowseBookmarks.java

  17 
vote

protected void onPreExecute(){
  progress=new ProgressDialog(mContext);
  progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  progress.setMessage("Loading. Please wait...");
  progress.setCancelable(true);
  progress.show();
}
 

Example 45

From project DeskSMS, under directory /DeskSMS/src/com/koushikdutta/desktopsms/.

Source file: MainActivity.java

  17 
vote

void startBuy(){
  ClockworkModBillingClient.getInstance().refreshMarketPurchases();
  final ProgressDialog dlg=new ProgressDialog(MainActivity.this);
  dlg.setMessage(getString(R.string.retrieving_status));
  dlg.show();
  ThreadingRunnable.background(new ThreadingRunnable(){
    @Override public void run(){
      try {
        final HttpGet get=new HttpGet(ServiceHelper.STATUS_URL);
        final JSONObject payload=ServiceHelper.retryExecuteAsJSONObject(MainActivity.this,mSettings.getString("account"),new URL(ServiceHelper.STATUS_URL),null);
        final long expiration=payload.getLong("subscription_expiration");
        foreground(new Runnable(){
          @Override public void run(){
            refreshAccount(expiration);
            dlg.dismiss();
            Intent i=new Intent(MainActivity.this,BuyActivity.class);
            i.putExtra("payload",payload.toString());
            startActivityForResult(i,2323);
          }
        }
);
      }
 catch (      Exception ex) {
        foreground(new Runnable(){
          @Override public void run(){
            dlg.dismiss();
            Helper.showAlertDialog(MainActivity.this,R.string.status_error);
          }
        }
);
        ex.printStackTrace();
      }
    }
  }
);
}
 

Example 46

From project DigitbooksExamples, under directory /DigitbooksExamples/src/fr/digitbooks/android/examples/chapitre08/.

Source file: RateDigitbooksActivity.java

  17 
vote

@Override protected Dialog onCreateDialog(int id){
switch (id) {
case DIALOG_RATE_NULL:
{
      return new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle(R.string.dialog_null_title).setMessage(getString(R.string.dialog_null_comment)).setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          rateDigitbooks();
          dismissDialog(DIALOG_RATE_NULL);
        }
      }
).setNegativeButton(android.R.string.cancel,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          dismissDialog(DIALOG_RATE_NULL);
        }
      }
).create();
    }
case DIALOG_PROGRESS:
{
    ProgressDialog dialog=new ProgressDialog(this);
    dialog.setMessage(getString(R.string.send_comment));
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);
    return dialog;
  }
}
return null;
}
 

Example 47

From project Diktofon, under directory /app/src/kaljurand_at_gmail_dot_com/diktofon/activity/.

Source file: RecordingListActivity.java

  17 
vote

LoadRecordings(Context context,int maxProgress){
  mProgressDialog=new ProgressDialog(context);
  mProgressDialog.setTitle(getString(R.string.message_loading_recordings));
  mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgressDialog.setProgress(0);
  mProgressDialog.setMax(maxProgress);
}
 

Example 48

From project droid-fu, under directory /src/main/java/com/github/droidfu/activities/.

Source file: BetterActivityHelper.java

  17 
vote

/** 
 * Creates a new ProgressDialog
 * @param activity
 * @param progressDialogTitleId The resource id for the title. If this is less than or equal to 0, a default title is used.
 * @param progressDialogMsgId The resource id for the message.
 * @return The new dialog
 */
public static ProgressDialog createProgressDialog(final Activity activity,int progressDialogTitleId,int progressDialogMsgId){
  ProgressDialog progressDialog=new ProgressDialog(activity);
  if (progressDialogTitleId <= 0) {
    progressDialogTitleId=activity.getResources().getIdentifier(PROGRESS_DIALOG_TITLE_RESOURCE,"string",activity.getPackageName());
  }
  progressDialog.setTitle(progressDialogTitleId);
  if (progressDialogMsgId <= 0) {
    progressDialogMsgId=activity.getResources().getIdentifier(PROGRESS_DIALOG_MESSAGE_RESOURCE,"string",activity.getPackageName());
  }
  progressDialog.setMessage(activity.getString(progressDialogMsgId));
  progressDialog.setIndeterminate(true);
  progressDialog.setOnKeyListener(new OnKeyListener(){
    public boolean onKey(    DialogInterface dialog,    int keyCode,    KeyEvent event){
      activity.onKeyDown(keyCode,event);
      return false;
    }
  }
);
  return progressDialog;
}
 

Example 49

From project android-aac-enc, under directory /src/com/todoroo/aacenc/.

Source file: Main.java

  16 
vote

private void write(){
  sr.setRecognitionListener(this);
  Intent intent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"com.domain.app");
  speechStarted=0;
  baos.reset();
  pd=new ProgressDialog(this);
  pd.setMessage("Speak now...");
  pd.setIndeterminate(true);
  pd.setCancelable(true);
  pd.setOnCancelListener(new OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      sr.cancel();
      onEndOfSpeech();
    }
  }
);
  pd.show();
  sr.startListening(intent);
  speechStarted=System.currentTimeMillis();
}
 

Example 50

From project Android-File-Manager-Tablet, under directory /src/com/nexes/manager/tablet/.

Source file: BluetoothActivity.java

  16 
vote

@Override public void onItemClick(AdapterView<?> list,View view,int pos,long id){
  final String name=mDeviceData.get(pos);
  String deviceName;
  if (name.equals("No Devices"))   return;
  mProgress=new ProgressDialog(BluetoothActivity.this);
  mProgress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  mProgress.setMessage("Sending...");
  deviceName=name.substring(0,name.lastIndexOf('\n'));
  if (mBluetoothAdapter.isDiscovering())   mBluetoothAdapter.cancelDiscovery();
  new AlertDialog.Builder(this).setTitle("Bluetooth Transfer").setMessage("Would you like to send this " + mFilePaths.length + " file(s) to "+ deviceName+ "?").setIcon(R.drawable.bluetooth).setPositiveButton("Yes",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      mProgress.show();
      new ClientSocketThread(name,handle).start();
    }
  }
).setNegativeButton("No",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      dialog.dismiss();
    }
  }
).create().show();
}
 

Example 51

From project android-rackspacecloud, under directory /src/com/rackspacecloud/android/.

Source file: CloudActivity.java

  16 
vote

protected final void showDialog(){
  if (pDialog == null || !pDialog.isShowing()) {
    isLoading=true;
    pDialog=new ProgressDialog(this);
    pDialog.setProgressStyle(R.style.NewDialog);
    pDialog.setOnCancelListener(new OnCancelListener(){
      @Override public void onCancel(      DialogInterface dialog){
        finish();
      }
    }
);
    pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    pDialog.show();
    pDialog.setContentView(new ProgressBar(this),new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
  }
}
 

Example 52

From project andstatus, under directory /src/org/andstatus/app/.

Source file: TimelineActivity.java

  16 
vote

@Override protected Dialog onCreateDialog(int id){
switch (id) {
case DIALOG_AUTHENTICATION_FAILED:
    return new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle(R.string.dialog_title_authentication_failed).setMessage(R.string.dialog_summary_authentication_failed).setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface Dialog,      int whichButton){
        startActivity(new Intent(TimelineActivity.this,PreferencesActivity.class));
      }
    }
).create();
case DIALOG_SERVICE_UNAVAILABLE:
  return new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle(R.string.dialog_title_service_unavailable).setMessage(R.string.dialog_summary_service_unavailable).setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface Dialog,    int whichButton){
    }
  }
).create();
case DIALOG_CONNECTION_TIMEOUT:
return new AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTitle(R.string.dialog_title_connection_timeout).setMessage(R.string.dialog_summary_connection_timeout).setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
  public void onClick(  DialogInterface Dialog,  int whichButton){
  }
}
).create();
case DIALOG_EXECUTING_COMMAND:
mProgressDialog=new ProgressDialog(this);
mProgressDialog.setIcon(android.R.drawable.ic_dialog_info);
mProgressDialog.setTitle(R.string.dialog_title_executing_command);
mProgressDialog.setMessage(getText(R.string.dialog_summary_executing_command));
return mProgressDialog;
default :
return super.onCreateDialog(id);
}
}
 

Example 53

From project Book-Catalogue, under directory /src/com/eleybourn/bookcatalogue/.

Source file: TaskManager.java

  16 
vote

/** 
 * Setup the progress dialog. If not called in the UI thread it will just queue initProgress().
 */
private void initProgress(){
  if (Thread.currentThread() == mUiThread.get()) {
synchronized (this) {
      Context ctx=mActivity;
      if (ctx != null && mProgress == null) {
        mProgress=new ProgressDialog(ctx);
        if (mProgressMax > 0) {
          mProgress.setIndeterminate(false);
          mProgress.setMax(mProgressMax);
          mProgress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        }
 else {
          mProgress.setIndeterminate(true);
          mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        }
        mProgress.setMessage(mProgressMessage);
        mProgress.setCancelable(true);
        mProgress.setOnKeyListener(mDialogKeyListener);
        mProgress.setOnCancelListener(mCancelHandler);
        mProgress.show();
        mProgress.setProgress(mProgressCount);
      }
    }
  }
 else {
    Message msg=mMessageHandler.obtainMessage();
    Bundle b=new Bundle();
    b.putString("__internal","initProgress");
    msg.setData(b);
    mMessageHandler.sendMessage(msg);
  }
}
 

Example 54

From project cmsandroid, under directory /src/com/zia/freshdocs/widget/.

Source file: CMISAdapter.java

  16 
vote

protected void startProgressDlg(boolean indeterminate){
  Context context=getContext();
  Resources res=context.getResources();
  if (_progressDlg == null || !_progressDlg.isShowing()) {
    _progressDlg=new ProgressDialog(context);
    _progressDlg.setProgressStyle(indeterminate ? ProgressDialog.STYLE_SPINNER : ProgressDialog.STYLE_HORIZONTAL);
    _progressDlg.setMessage(res.getString(R.string.loading));
    _progressDlg.setTitle("");
    _progressDlg.setCancelable(true);
    _progressDlg.setIndeterminate(indeterminate);
    _progressDlg.setOnCancelListener(new OnCancelListener(){
      public void onCancel(      DialogInterface dialog){
        interrupt();
      }
    }
);
    _progressDlg.show();
  }
}
 

Example 55

From project dmix, under directory /MPDroid/src/com/namelessdev/mpdroid/.

Source file: MPDApplication.java

  16 
vote

private void connectMPD(){
  dismissAlertDialog();
  if (!isNetworkConnected()) {
    connectionFailed("No network.");
    return;
  }
  if (currentActivity != null) {
    ad=new ProgressDialog(currentActivity);
    ad.setTitle(getResources().getString(R.string.connecting));
    ad.setMessage(getResources().getString(R.string.connectingToServer));
    ad.setCancelable(false);
    ad.setOnKeyListener(new OnKeyListener(){
      public boolean onKey(      DialogInterface dialog,      int keyCode,      KeyEvent event){
        return true;
      }
    }
);
    try {
      ad.show();
    }
 catch (    BadTokenException e) {
    }
  }
  cancelDisconnectSheduler();
  oMPDAsyncHelper.connect();
}
 

Example 56

From project 2Degrees-Toolbox, under directory /Toolbox/src/biz/shadowservices/DegreesToolbox/.

Source file: MainActivity.java

  15 
vote

private void forceUpdate(){
  progressDialog=ProgressDialog.show(this,null," Loading. Please wait ... ",true);
  progressDialog.show();
  Intent update=new Intent(this,UpdateWidgetService.class);
  update.putExtra("biz.shadowservices.PhoneBalanceWidget.forceUpdates",true);
  startService(update);
  GATracker.getInstance().trackEvent("Actions","Manual Refresh","MainActivity",0);
}
 

Example 57

From project Absolute-Android-RSS, under directory /src/com/AA/Activities/.

Source file: AAMain.java

  15 
vote

/** 
 * Runs the fetching service. Pops up with a progress dialog, so that the user knows something is happening in the background.
 */
private void runService(){
  progressDialog=ProgressDialog.show(this,"","Loading News. Please Wait...");
  progressDialog.setCancelable(true);
  Intent service=new Intent();
  service.putExtra("background",false);
  service.setClass(AAMain.this,RssService.class);
  AAMain.this.startService(service);
}
 

Example 58

From project AlarmApp-Android, under directory /src/org/alarmapp/util/.

Source file: ActivityUtil.java

  15 
vote

public static void startProgressBar(final Activity activity){
  activity.runOnUiThread(new Runnable(){
    public void run(){
      pDialog=new ProgressDialog(activity);
      pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      pDialog.setMessage("Laden");
      pDialog.setCancelable(false);
      pDialog.show();
    }
  }
);
}
 

Example 59

From project alljoyn_java, under directory /samples/android/contacts/ContactsClient/src/org/alljoyn/bus/samples/contacts_client/.

Source file: ContactsClient.java

  15 
vote

@Override public void handleMessage(Message msg){
switch (msg.what) {
case MESSAGE_DISPLAY_ALL_CONTACTS:
    mContactNames=(NameId[])msg.obj;
  mContactsListAdapter.clear();
mGetContactsBtn.setText(getString(R.string.update_contacts));
for (int i=0; i < mContactNames.length; i++) {
mContactsListAdapter.add(mContactNames[i].displayName);
}
break;
case MESSAGE_DISPLAY_CONTACT:
mAddressEntry=(Contact)msg.obj;
showDialog(DIALOG_CONTACT);
break;
case MESSAGE_POST_TOAST:
Toast.makeText(getApplicationContext(),(String)msg.obj,Toast.LENGTH_LONG).show();
break;
case MESSAGE_START_PROGRESS_DIALOG:
mDialog=ProgressDialog.show(ContactsClient.this,"","Finding Contacts Service.\nPlease wait...",true,true);
break;
case MESSAGE_STOP_PROGRESS_DIALOG:
mDialog.dismiss();
break;
default :
break;
}
}
 

Example 60

From project and-bible, under directory /AndBible/src/net/bible/android/view/util/.

Source file: Hourglass.java

  15 
vote

public void show(){
  final Activity activity=CurrentActivityHolder.getInstance().getCurrentActivity();
  if (activity != null) {
    activity.runOnUiThread(new Runnable(){
      @Override public void run(){
        hourglass=new ProgressDialog(activity);
        hourglass.setMessage(BibleApplication.getApplication().getText(R.string.please_wait));
        hourglass.setIndeterminate(true);
        hourglass.setCancelable(false);
        hourglass.show();
      }
    }
);
  }
}
 

Example 61

From project android-bankdroid, under directory /src/com/liato/bankdroid/.

Source file: DataRetrieverTask.java

  15 
vote

@Override protected void onPreExecute(){
  this.dialog.setMessage(res.getText(R.string.updating_account_balance) + "\n ");
  this.dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  this.dialog.setCancelable(false);
  this.dialog.show();
}
 

Example 62

From project android-cropimage, under directory /src/com/android/camera/.

Source file: Util.java

  15 
vote

public BackgroundJob(MonitoredActivity activity,Runnable job,ProgressDialog dialog,Handler handler){
  mActivity=activity;
  mDialog=dialog;
  mJob=job;
  mActivity.addLifeCycleListener(this);
  mHandler=handler;
}
 

Example 63

From project Android-File-Manager, under directory /src/com/nexes/manager/.

Source file: EventHandler.java

  15 
vote

/** 
 * This is done on the EDT thread. this is called before  doInBackground is called
 */
@Override protected void onPreExecute(){
switch (type) {
case SEARCH_TYPE:
    pr_dialog=ProgressDialog.show(mContext,"Searching","Searching current file system...",true,true);
  break;
case COPY_TYPE:
pr_dialog=ProgressDialog.show(mContext,"Copying","Copying file...",true,false);
break;
case UNZIP_TYPE:
pr_dialog=ProgressDialog.show(mContext,"Unzipping","Unpacking zip file please wait...",true,false);
break;
case UNZIPTO_TYPE:
pr_dialog=ProgressDialog.show(mContext,"Unzipping","Unpacking zip file please wait...",true,false);
break;
case ZIP_TYPE:
pr_dialog=ProgressDialog.show(mContext,"Zipping","Zipping folder...",true,false);
break;
case DELETE_TYPE:
pr_dialog=ProgressDialog.show(mContext,"Deleting","Deleting files...",true,false);
break;
}
}
 

Example 64

From project android-flash-cards, under directory /src/org/thomasamsler/android/flashcards/conversion/.

Source file: FileToDbConversion.java

  15 
vote

public void convert(Context context,DataSource dataSource){
  this.mContext=context;
  this.mDataSource=dataSource;
  mDialog=ProgressDialog.show(context,"",mContext.getString(R.string.conversion),true);
  new ConversionTask().execute();
}
 

Example 65

From project Android-Flashcards, under directory /src/com/secretsockssoftware/androidflashcards/.

Source file: LessonDownload.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.lesson_download);
  Bundle extras=getIntent().getExtras();
  lname=extras.getString("LessonName");
  ldesc=extras.getString("LessonDesc");
  lurl=extras.getString("LessonUrl");
  lfilt=extras.getString("LessonFilter");
  ltarget=extras.getString("LessonTarget");
  lenc=extras.getString("LessonEncoding");
  me=this;
  setResult(0);
  final TextView nametv=(TextView)findViewById(R.id.lesson_name_tv);
  nametv.setText(lname);
  final TextView desctv=(TextView)findViewById(R.id.lesson_desc_tv);
  desctv.setText(ldesc);
  final Button cancel_button=(Button)findViewById(R.id.cancel_button);
  cancel_button.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      finish();
    }
  }
);
  final Button dl_button=(Button)findViewById(R.id.download_button);
  dl_button.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      pd=ProgressDialog.show(me,"","Downloading lesson...",true);
      Thread t=new Thread(me);
      t.start();
    }
  }
);
}
 

Example 66

From project androidTileMapEditor_1, under directory /src/it/sineo/android/tileMapEditor/.

Source file: HomeActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  if (C.DEVELOPER_MODE) {
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().penaltyDeathOnNetwork().build());
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
  }
  super.onCreate(savedInstanceState);
  setContentView(R.layout.home);
  gvPreview=(GridView)findViewById(R.id.home_grid);
  emptyGrid=getLayoutInflater().inflate(R.layout.home_grid_empty,null);
  emptyGrid.findViewById(R.id.home_grid_empty).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      showDialog(C.DIALOG_NEW_MAP);
    }
  }
);
  @SuppressWarnings("deprecation") int emptyGrid_layout_size=LayoutParams.FILL_PARENT;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
    emptyGrid_layout_size=LayoutParams.MATCH_PARENT;
  }
  addContentView(emptyGrid,new LayoutParams(emptyGrid_layout_size,emptyGrid_layout_size));
  gvPreview.setEmptyView(emptyGrid);
  getSupportLoaderManager().initLoader(0,null,this);
  String[] cols=new String[]{"_id","_name","_json_data","_last_update"};
  adapter=new MySimpleCursorAdapter(getApplicationContext(),R.layout.home_grid_item,null,cols,null,0);
  gvPreview.setAdapter(adapter);
  gvPreview.setOnItemClickListener(this);
  registerForContextMenu(gvPreview);
  progressDialog=ProgressDialog.show(HomeActivity.this,null,getString(R.string.home_dlg_loading_maps),true);
}
 

Example 67

From project android_5, under directory /src/aarddict/android/.

Source file: DiscoveryProgressDialog.java

  15 
vote

DiscoveryProgressDialog(Context context){
  super(context);
  setCancelable(false);
  setIndeterminate(true);
  setProgressStyle(ProgressDialog.STYLE_SPINNER);
  setMessage(context.getString(R.string.msgLooking));
}
 

Example 68

From project android_packages_apps_Gallery, under directory /src/com/android/camera/.

Source file: GalleryPicker.java

  15 
vote

public void updateScanningDialog(boolean scanning){
  boolean prevScanning=(mMediaScanningDialog != null);
  if (prevScanning == scanning && mAdapter.mItems.size() == 0)   return;
  if (prevScanning) {
    mMediaScanningDialog.cancel();
    mMediaScanningDialog=null;
  }
 else   if (scanning && mAdapter.mItems.size() == 0) {
    mMediaScanningDialog=ProgressDialog.show(this,null,getResources().getString(R.string.wait),true,true);
  }
}
 

Example 69

From project android_packages_apps_Gallery3D, under directory /src/com/cooliris/media/.

Source file: Photographs.java

  15 
vote

@Override public void handleMessage(Message msg){
switch (msg.what) {
case SHOW_PROGRESS:
{
      CharSequence c=getText(Res.string.wallpaper);
      mProgressDialog=ProgressDialog.show(Photographs.this,"",c,true,false);
      break;
    }
case FINISH:
{
    closeProgressDialog();
    setResult(RESULT_OK);
    finish();
    break;
  }
}
}
 

Example 70

From project andtweet, under directory /src/com/xorcode/andtweet/.

Source file: PreferencesActivity.java

  15 
vote

@Override protected void onPreExecute(){
  dlg=ProgressDialog.show(PreferencesActivity.this,getText(R.string.dialog_title_checking_credentials),getText(R.string.dialog_summary_checking_credentials),true,false);
  if (PreferencesActivity.this.mCredentialsAreBeingVerified) {
    skip=true;
  }
 else {
    PreferencesActivity.this.mCredentialsAreBeingVerified=true;
  }
}
 

Example 71

From project Anki-Android, under directory /src/com/ichi2/anki/.

Source file: DeckPicker.java

  15 
vote

@Override public void onProgressUpdate(Object... values){
  if (mProgressDialog == null || !mProgressDialog.isShowing()) {
    mProgressDialog=ProgressDialog.show(DeckPicker.this,(String)values[0],(String)values[1]);
  }
 else {
    mProgressDialog.setTitle((String)values[0]);
    mProgressDialog.setMessage((String)values[1]);
  }
}
 

Example 72

From project anode, under directory /src/net/haltcondition/anode/.

Source file: EditSettings.java

  15 
vote

private void initiateServiceFetch(){
  Log.d(TAG,"Fetching Service ID");
  Account account=new Account(eUsername.getText().toString(),ePassword.getText().toString());
  progress=ProgressDialog.show(this,getResources().getString(R.string.fetching_service),getResources().getString(R.string.starting_worker),false,true);
  HttpWorker<Service> serviceWorker=new HttpWorker<Service>(new Handler(this),account,Common.INODE_URI_BASE,new ServiceParser(),this);
  pool.execute(serviceWorker);
}
 

Example 73

From project Birthdays, under directory /src/com/rexmenpara/birthdays/.

Source file: BirthdaysActivity.java

  15 
vote

private void loadData(){
  dialog=ProgressDialog.show(this,"","Loading...",true);
  new Thread(){
    public void run(){
      db.open();
      Cursor mainDataCursor=db.getAllEntriesForView();
      ArrayList<BirthdayBean> mainDataList=new ArrayList<BirthdayBean>();
      while (mainDataCursor.moveToNext()) {
        BirthdayBean bean=new BirthdayBean();
        int rowIdCol=mainDataCursor.getColumnIndex(DBAdapter.KEY_ROWID);
        bean.setRowId(mainDataCursor.getLong(rowIdCol));
        int nameCol=mainDataCursor.getColumnIndex(DBAdapter.KEY_NAME);
        bean.setName(mainDataCursor.getString(nameCol));
        int contactIdCol=mainDataCursor.getColumnIndex(DBAdapter.KEY_CONTACTID);
        bean.setContactId(mainDataCursor.getLong(contactIdCol));
        int birthdayCol=mainDataCursor.getColumnIndex(DBAdapter.KEY_BDAY);
        bean.setBirthday(mainDataCursor.getString(birthdayCol));
        int reminderCol=mainDataCursor.getColumnIndex(DBAdapter.KEY_REMINDER);
        bean.setReminder(mainDataCursor.getInt(reminderCol) == 1);
        mainDataList.add(bean);
      }
      mainDataCursor.close();
      BirthdayBean[] mainDataArray=null;
      mainDataArray=new BirthdayBean[mainDataList.size()];
      Arrays.sort(mainDataList.toArray(mainDataArray),new BirthdayComparator());
      Message msg=Message.obtain();
      msg.arg1=MESSAGE_DATA_LOAD;
      msg.obj=mainDataArray;
      mHandler.sendMessage(msg);
      db.close();
      mHandler.post(mLoadEntries);
    }
  }
.start();
}
 

Example 74

From project BombusLime, under directory /src/org/bombusim/lime/activity/.

Source file: VCardActivity.java

  15 
vote

private void queryVCard(){
  mPgsDialog=ProgressDialog.show(this,"",getString(R.string.loadingVcardProgress),true,true,new OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      onBackPressed();
    }
  }
);
  mVcardQuery=new IqVcard();
  mVcardQuery.setVcardListener(new IqVcard.VCardListener(){
    @Override public void onVcardArrived(    String from,    Vcard result){
      mVcard=result;
      mHandler.post(new Runnable(){
        @Override public void run(){
          mPgsDialog.dismiss();
          showVcardContent();
        }
      }
);
    }
  }
);
  XmppStream s=mSb.getXmppStream(mRJid);
  mVcardQuery.vcardRequest(mJid,s);
}
 

Example 75

From project bookmarktodesktop-android-application, under directory /src/be/vbsteven/bmtodesk/.

Source file: RegistrationActivity.java

  15 
vote

/** 
 * shows progress dialog for login
 */
private void showLoginProgress(){
  if (progress != null) {
    progress.dismiss();
  }
  progress=ProgressDialog.show(this,"Bookmark to Desktop","Attempting login...");
}
 

Example 76

From project BreizhCamp-android, under directory /src/org/breizhjug/breizhcamp/util/.

Source file: XmlLoader.java

  15 
vote

public XmlLoader(Context context){
  super();
  this.context=context;
  waitDialog=ProgressDialog.show(context,null,"Chargement de l'?venement...");
  waitDialog.setOnCancelListener(new OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      XmlLoader.this.cancel(true);
    }
  }
);
}
 

Example 77

From project Catroid-maven-playground, under directory /src/main/java/at/tugraz/ist/catroid/stage/.

Source file: PreStageActivity.java

  15 
vote

private void startBTComm(boolean autoConnect){
  connectingProgressDialog=ProgressDialog.show(this,"",getResources().getString(R.string.connecting_please_wait),true);
  Intent serverIntent=new Intent(this,DeviceListActivity.class);
  serverIntent.putExtra(DeviceListActivity.AUTO_CONNECT,autoConnect);
  this.startActivityForResult(serverIntent,REQUEST_CONNECT_DEVICE);
}
 

Example 78

From project com.juick.android, under directory /src/com/juick/android/.

Source file: PickPlaceActivity.java

  15 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  Utils.updateTheme(this);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.pickplace);
  bNewPlace=(Button)findViewById(R.id.buttonNewPlace);
  bNonamePlace=(Button)findViewById(R.id.buttonNonamePlace);
  bNewPlace.setOnClickListener(this);
  bNonamePlace.setOnClickListener(this);
  listAdapter=new JuickPlacesAdapter(this);
  getListView().setAdapter(listAdapter);
  getListView().setOnItemClickListener(this);
  getListView().setOnItemLongClickListener(this);
  lm=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
  Criteria c=new Criteria();
  c.setAccuracy(Criteria.ACCURACY_FINE);
  String bestProvider=lm.getBestProvider(c,true);
  if (bestProvider == null || bestProvider.length() == 0) {
    AlertDialog.Builder builder=new AlertDialog.Builder(this);
    builder.setCancelable(false);
    builder.setMessage(R.string.Location_determination_is_disabled);
    builder.setPositiveButton(R.string.Settings,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface arg0,      int arg1){
        startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS),ACTIVITY_SETTINGS);
      }
    }
);
    builder.setNegativeButton(R.string.Cancel,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        PickPlaceActivity.this.setResult(RESULT_CANCELED);
        PickPlaceActivity.this.finish();
      }
    }
);
    builder.show();
    return;
  }
  lm.requestLocationUpdates(bestProvider,0,0,this);
  progressDialog=ProgressDialog.show(this,"",getResources().getString(R.string.Determining_your_location___),true,true,this);
}
 

Example 79

From project cropimage, under directory /src/com/droid4you/util/cropimage/.

Source file: Util.java

  15 
vote

public BackgroundJob(MonitoredActivity activity,Runnable job,ProgressDialog dialog,Handler handler){
  mActivity=activity;
  mDialog=dialog;
  mJob=job;
  mActivity.addLifeCycleListener(this);
  mHandler=handler;
}