progress dialog

172
Android Application Development Training Tutorial For more info visit http://www.zybotech.in A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

Upload: zybotechsolutions

Post on 27-Oct-2014

116 views

Category:

Documents


0 download

DESCRIPTION

Progress Dialog,Android training in cochin- android training in cochin, android training centre in cochin android training institute in cochin android training programmes, android training in kerala, training centres in kerala-android training in Kerala-best android training in kochi-certified android training courses in Cochin -Android application development training in cochin-kochi, Ernakulum- Kerala-mobile application jobs-mobile application development training- android jobs in cochin-college projects in android-mobile application programmer-android development training-certified courses on mobile application- android application development-corporate job oriented android training-placement oriented android training-zybotech android training courses-job oriented android training programme

TRANSCRIPT

Android Application Development Training Tutorial

For more info visit http://www.zybotech.in

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

ProgressDialogClass OverviewA dialog showing a progress indicator and an optional text message or view. Only a text message or a view can be used at the same time. The dialog can be made cancelable on back key press. The progress range is 0..10000.

SummaryConstants int STYLE_HORIZONTAL Creates a ProgressDialog with a horizontal progress bar. int STYLE_SPINNER Creates a ProgressDialog with a ciruclar, spinning progress bar. [Expand] Inherited Constants From interface android.content.DialogInterface int BUTTON1 int BUTTON2 int BUTTON3 This constant is deprecated. Use BUTTON_POSITIVE This constant is deprecated. Use BUTTON_NEGATIVE This constant is deprecated. Use BUTTON_NEUTRAL

int BUTTON_NEGATIVE The identifier for the negative button. int BUTTON_NEUTRAL The identifier for the neutral button. int BUTTON_POSITIVE The identifier for the positive button. Public Constructors ProgressDialog(Context context) ProgressDialog(Context context, int theme) A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

Public Methods int int int void void boolean getMax() getProgress() getSecondaryProgress() incrementProgressBy(int diff) incrementSecondaryProgressBy(int diff) isIndeterminate() onStart() void Called when the dialog is starting. void void void void void void void void setIndeterminate(boolean indeterminate) setIndeterminateDrawable(Drawable d) setMax(int max) setMessage(CharSequence message) setProgress(int value) setProgressDrawable(Drawable d) setProgressStyle(int style) setSecondaryProgress(int secondaryProgress)

static show(Context context, CharSequence title, CharSequence message) ProgressDialog static show(Context context, CharSequence title, CharSequence message, boolean indeterminate) ProgressDialog static show(Context context, CharSequence title, CharSequence message, boolean indeterminate, ProgressDialog boolean cancelable) static show(Context context, CharSequence title, CharSequence message, boolean indeterminate, ProgressDialog boolean cancelable, DialogInterface.OnCancelListener cancelListener) Protected Methods

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

onCreate(Bundle savedInstanceState) void Similar to onCreate(Bundle), you should initialized your dialog in this method, including callingsetContentView(View).

onStop() void Called to tell you that you're stopping. [Expand] Inherited Methods From class android.app.AlertDialog getButton(int whichButton) Button Gets one of the buttons used in the dialog. getListView() ListView Gets the list view used in the dialog. onCreate(Bundle savedInstanceState) void Similar to onCreate(Bundle), you should initialized your dialog in this method, including calling setContentView(View). onKeyDown(int keyCode, KeyEvent event) boolean A key was pressed down. onKeyUp(int keyCode, KeyEvent event) boolean A key was released. setButton(CharSequence text, Message msg) void This method is deprecated. Use setButton(int, CharSequence, Message) with BUTTON_POSITIVE. setButton(int whichButton, CharSequence text, Message msg) void Set a message to be sent when a button is pressed. setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener) void Set a listener to be invoked when the positive button of the dialog is pressed. void setButton(CharSequence text, DialogInterface.OnClickListener listener) This method is deprecated. Use setButton(int, CharSequence, A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

android.content.DialogInterface.OnClickListener) with BUTTON_POSITIVE

setButton2(CharSequence text, Message msg) void This method is deprecated. Use setButton(int, CharSequence, Message) with BUTTON_NEGATIVE. setButton2(CharSequence text, DialogInterface.OnClickListener listener) void This method is deprecated. Use setButton(int, CharSequence, android.content.DialogInterface.OnClickListener) with BUTTON_NEGATIVE setButton3(CharSequence text, DialogInterface.OnClickListener listener) void This method is deprecated. Use setButton(int, CharSequence, android.content.DialogInterface.OnClickListener) with BUTTON_POSITIVE setButton3(CharSequence text, Message msg) void This method is deprecated. Use setButton(int, CharSequence, Message) with BUTTON_NEUTRAL. void void setCustomTitle(View customTitleView) setIcon(Drawable icon) setIcon(int resId) void Set resId to 0 if you don't want an icon. void void setInverseBackgroundForced(boolean forceInverseBackground) setMessage(CharSequence message) setTitle(CharSequence title) void Set the title text for this dialog's window. setView(View view) void Set the view to display in that dialog. setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) void Set the view to display in that dialog, specifying the spacing to appear around that view. From class android.app.Dialog addContentView(View view, ViewGroup.LayoutParams params) void Add an additional content view to the screen.

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

cancel() void Cancel the dialog. void closeOptionsMenu() dismiss() void Dismiss this dialog, removing it from the screen. dispatchKeyEvent(KeyEvent event) boolean Called to process key events. dispatchPopulateAccessibilityEvent(AccessibilityEvent event) boolean Called to process population of AccessibilityEvents. dispatchTouchEvent(MotionEvent ev) boolean Called to process touch screen events. dispatchTrackballEvent(MotionEvent ev) boolean Called to process trackball events. findViewById(int id) View Finds a view that was identified by the id attribute from the XML that was processed in onStart(). getContext() final Context Retrieve the Context this Dialog is running in. getCurrentFocus() View Call getCurrentFocus() on the Window if this Activity to return the currently focused view. LayoutInflater getLayoutInflater() getOwnerActivity() final Activity Returns the Activity that owns this Dialog. final int getVolumeControlStream() getWindow() Window Retrieve the current Window for the activity.

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

hide() void Hide the dialog, but do not dismiss it. boolean isShowing() onAttachedToWindow() void Called when the window has been attached to the window manager. onBackPressed() void Called when the dialog has detected the user's press of the back key. onContentChanged() void This hook is called whenever the content view of the screen changes (due to a call to Window.setContentView or Window.addContentView). onContextItemSelected(MenuItem item) onContextMenuClosed(Menu menu) onCreate(Bundle savedInstanceState) void Similar to onCreate(Bundle), you should initialized your dialog in this method, including calling setContentView(View). onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) void Called when the context menu for this view is being built. onCreateOptionsMenu(Menu menu) boolean It is usually safe to proxy this call to the owner activity's onCreateOptionsMenu(Menu) if the client desires the same menu for this Dialog. onCreatePanelMenu(int featureId, Menu menu) boolean Initialize the contents of the menu for panel 'featureId'. onCreatePanelView(int featureId) View Instantiate the view to display in the panel for 'featureId'. onDetachedFromWindow() void Called when the window has been attached to the window manager.

boolean void

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

onKeyDown(int keyCode, KeyEvent event) boolean A key was pressed down. onKeyLongPress(int keyCode, KeyEvent event) boolean Default implementation of KeyEvent.Callback.onKeyLongPress(): always returns false (doesn't handle the event). onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) boolean Default implementation of KeyEvent.Callback.onKeyMultiple(): always returns false (doesn't handle the event). onKeyUp(int keyCode, KeyEvent event) boolean A key was released. onMenuItemSelected(int featureId, MenuItem item) boolean Called when a panel's menu item has been selected by the user. onMenuOpened(int featureId, Menu menu) boolean Called when a panel's menu is opened by the user. boolean void onOptionsItemSelected(MenuItem item) onOptionsMenuClosed(Menu menu) onPanelClosed(int featureId, Menu menu) void Called when a panel is being closed. onPrepareOptionsMenu(Menu menu) boolean It is usually safe to proxy this call to the owner activity's onPrepareOptionsMenu(Menu) if the client desires the same menu for this Dialog. onPreparePanel(int featureId, View view, Menu menu) boolean Prepare a panel to be displayed. onRestoreInstanceState(Bundle savedInstanceState) void Restore the state of the dialog from a previously saved bundle. onSaveInstanceState() Bundle Saves the state of the dialog into a bundle. A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

onSearchRequested() boolean This hook is called when the user signals the desire to start a search. onStart() void Called when the dialog is starting. onStop() void Called to tell you that you're stopping. onTouchEvent(MotionEvent event) boolean Called when a touch screen event was not handled by any of the views under it. onTrackballEvent(MotionEvent event) boolean Called when the trackball was moved and not handled by any of the views inside of the activity. onWindowAttributesChanged(WindowManager.LayoutParams params) void This is called whenever the current window attributes change. onWindowFocusChanged(boolean hasFocus) void This hook is called whenever the window focus changes. void void void openContextMenu(View view) openOptionsMenu() registerForContextMenu(View view) requestWindowFeature(int featureId) final boolean Enable extended window features. setCancelMessage(Message msg) void Set a message to be sent when the dialog is canceled. setCancelable(boolean flag) void Sets whether this dialog is cancelable with the BACK key. setCanceledOnTouchOutside(boolean cancel) void Sets whether this dialog is canceled when touched outside the window's bounds.

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

setContentView(View view, ViewGroup.LayoutParams params) void Set the screen content to an explicit view. setContentView(View view) void Set the screen content to an explicit view. setContentView(int layoutResID) void Set the screen content from a layout resource. setDismissMessage(Message msg) void Set a message to be sent when the dialog is dismissed. setFeatureDrawable(int featureId, Drawable drawable) final void Convenience for calling setFeatureDrawable(int, Drawable). setFeatureDrawableAlpha(int featureId, int alpha) final void Convenience for calling setFeatureDrawableAlpha(int, int). setFeatureDrawableResource(int featureId, int resId) final void Convenience for calling setFeatureDrawableResource(int, int). setFeatureDrawableUri(int featureId, Uri uri) final void Convenience for calling setFeatureDrawableUri(int, Uri). setOnCancelListener(DialogInterface.OnCancelListener listener) void Set a listener to be invoked when the dialog is canceled. setOnDismissListener(DialogInterface.OnDismissListener listener) void Set a listener to be invoked when the dialog is dismissed. setOnKeyListener(DialogInterface.OnKeyListener onKeyListener) void Sets the callback that will be called if a key is dispatched to the dialog. setOnShowListener(DialogInterface.OnShowListener listener) void Sets a listener to be invoked when the dialog is shown. final void setOwnerActivity(Activity activity)

A7, Stephanos Tower, Eachamukku, Kakkanadu,Kochi

Sets the Activity that owns this dialog. setTitle(int titleId) void Set the title text for this dialog's window. setTitle(CharSequence title) void Set the title text for this dialog's window. setVolumeControlStream(int streamType) final void By default, this will use the owner Activity's suggested stream type. show() void Start the dialog and display it on screen. takeKeyEvents(boolean get) void Request that key events come to this dialog. void unregisterForContextMenu(View view)

From class java.lang.Object clone() Object Creates and returns a copy of this Object. equals(Object o) boolean Compares this instance with the specified object and indicates if they are equal. finalize() void Is called before the object's memory is being reclaimed by the VM. getClass() final Class