Code example for ProgressDialog

Methods: setMessagesetProgress

0
                final double fspeed = speed;
                 
                activity.runOnUiThread( new Runnable() {
					@Override 
					public void run() { 
						progress.setMessage( "[ " + formatSpeed( (int)fspeed ) + " ] " + formatSize( fdown) + " / " + formatSize( ftot ) + " ..." );
						progress.setProgress( ( 100 * fdown ) / ftot );
					}                	 
                }); 
                 
            } 
             
            writer.close();
            reader.close();
 
            if( progress.isShowing() )
            { 
	            Intent intent = new Intent( Intent.ACTION_VIEW );
	            intent.setDataAndType( Uri.fromFile( file ), "application/vnd.android.package-archive" );
	            intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
Stop searching for code, let great code find you!  Add Codota to your java IDE