{"id":4009,"date":"2013-05-30T01:17:36","date_gmt":"2013-05-29T22:17:36","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=4009"},"modified":"2019-05-09T11:17:42","modified_gmt":"2019-05-09T08:17:42","slug":"android-progressdialog-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/","title":{"rendered":"Android ProgressDialog Example"},"content":{"rendered":"<p>Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of time, for example a file or an Image download.<\/p>\n<p>In this tutorial will create a <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/ProgressDialog.html\">ProgressDialog<\/a> to let the user know the progress and a status of a simulated Image download activity.<\/p>\n<p>We will &nbsp;demonstrate both the Ring and the Bar style of the&nbsp;<a href=\"http:\/\/developer.android.com\/reference\/android\/app\/ProgressDialog.html\">ProgressDialog<\/a>&nbsp;component, as well as the use of special tools like <a href=\"http:\/\/examples.javacodegeeks.com\/android\/core\/os\/handler\/android-handler-example\/\"><code>Handler<\/code><\/a> to update the value ( progress&#8230;) of the bar format.<\/p>\n<p>For this tutorial, we will use the following tools in a Windows 64-bit platform:<\/p>\n<ol>\n<li>JDK 1.7<\/li>\n<li>Eclipse 4.2 Juno<\/li>\n<li>Android SKD 4.2<\/li>\n<\/ol>\n<h3>1. Create a new Android Project<\/h3>\n<p>Open Eclipse IDE and go to File -&gt; New -&gt; Project -&gt; Android -&gt; Android Application Project.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-application.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4011\" alt=\"create-new-application\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-application.jpg\" width=\"448\" height=\"425\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-application.jpg 448w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-application-300x284.jpg 300w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/a><\/p>\n<p>You have to specify the Application Name, the Project Name and the Package name in the appropriate text fields and then click Next.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-project1.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4012\" alt=\"create-new-project\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-project1.jpg\" width=\"520\" height=\"427\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-project1.jpg 520w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-new-project1-300x246.jpg 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p>In the next window make sure the \u201cCreate activity\u201d option is selected in order to create a new activity for your project, and click Next. This is optional as you can create a new activity after creating the project, but you can do it all in one step.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/check-create-new-activity13.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4010\" alt=\"check-create-new-activity\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/check-create-new-activity13.jpg\" width=\"530\" height=\"481\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/check-create-new-activity13.jpg 530w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/check-create-new-activity13-300x272.jpg 300w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><\/a><\/p>\n<p>Select \u201cBlankActivity\u201d and click Next.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"http:\/\/cdn.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/create-blanc-activity.jpg\"><\/p>\n<p>You will be asked to specify some information about the new activity. &nbsp;In the Layout Name text field you have to specify the name of the file that will contain the layout description of your app. In our case the file&nbsp;<code>res\/layout\/main.xml<\/code>&nbsp;will be created. Then, click Finish.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"http:\/\/cdn.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/new-activity-attr.jpg\"><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3><\/h3>\n<h3>3. Creating the layout of the Main Activity<\/h3>\n<p>Open&nbsp;<code>res\/layout\/main.xml<\/code>&nbsp;file :<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-xml11.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4016\" alt=\"main-xml\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-xml11.jpg\" width=\"305\" height=\"533\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-xml11.jpg 305w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-xml11-171x300.jpg 171w\" sizes=\"(max-width: 305px) 100vw, 305px\" \/><\/a><\/p>\n<p>And paste the following code :<\/p>\n<p><em><span style=\"text-decoration: underline;\">main.xml:<\/span><\/em><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" &gt;\n\n    &lt;Button\n        android:id=\"@+id\/btn1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:onClick=\"launchBarDialog\"\n        android:text=\"ProgressDialog Bar\" \/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/btn2\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:onClick=\"launchRingDialog\"\n        android:text=\"ProgressDialog Ring\" \/&gt;\n\n&lt;\/LinearLayout&gt;<\/pre>\n<p>Now you may open the Graphical layout editor to preview the User Interface you created:<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/graphical-layout-efitor.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4013\" alt=\"graphical-layout-efitor\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/graphical-layout-efitor.jpg\" width=\"556\" height=\"714\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/graphical-layout-efitor.jpg 556w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/graphical-layout-efitor-233x300.jpg 233w\" sizes=\"(max-width: 556px) 100vw, 556px\" \/><\/a><\/p>\n<h3>4. Code<\/h3>\n<p>Now we have to write the code of the application. Use the Package Explorer to navigate to the Java file of the Activity you\u2019ve created:<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-src-file5.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4015\" alt=\"main-src-file\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-src-file5.jpg\" width=\"480\" height=\"306\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-src-file5.jpg 480w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-src-file5-300x191.jpg 300w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>The basic idea of the progress dialog is to display the status of a time consuming activity while that activity takes place. The most common way to do that is to use a thread that will do all the work, in our case simulate the downloading of a file, and&nbsp;update the UI (that is the progress bar) using a <code>Handler<\/code>.&nbsp;The <code>Handler<\/code> takes a&nbsp;<a href=\"http:\/\/docs.oracle.com\/javase\/7\/docs\/api\/java\/lang\/Runnable.html\">Runnable<\/a>&nbsp;object and it schedules its execution; it places the runnable process as a job in an execution queue&nbsp;to be run after a specified amount of time. The runnable will be run on the thread to which this handler is attached. In our case the handler is registerd in the main thread.<\/p>\n<p>Go to the java file that contains the code of the activity&nbsp;you\u2019ve&nbsp;just created and paste the following code:[ulp id=&#8217;XSQzgZ7lDbTb31Tj&#8217;]<\/p>\n<p><em><span style=\"text-decoration: underline;\">MainActivity.java:<\/span><\/em><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.androidprogressdialogexample;\n\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.view.View;\n\npublic class MainActivity extends Activity {\n\n\tProgressDialog barProgressDialog;\n\tHandler updateBarHandler;\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.main);\n\n\t\tupdateBarHandler = new Handler();\n\t}\n\n\tpublic void launchRingDialog(View view) {\n\t\tfinal ProgressDialog ringProgressDialog = ProgressDialog.show(MainActivity.this, \"Please wait ...\",\t\"Downloading Image ...\", true);\n\t\tringProgressDialog.setCancelable(true);\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\t\/\/ Here you should write your time consuming task...\n\t\t\t\t\t\/\/ Let the progress ring for 10 seconds...\n\t\t\t\t\tThread.sleep(10000);\n\t\t\t\t} catch (Exception e) {\n\n\t\t\t\t}\n\t\t\t\tringProgressDialog.dismiss();\n\t\t\t}\n\t\t}).start();\n\t}\n\n\tpublic void launchBarDialog(View view) {\n\t\tbarProgressDialog = new ProgressDialog(MainActivity.this);\n\n\t\tbarProgressDialog.setTitle(\"Downloading Image ...\");\n\t\tbarProgressDialog.setMessage(\"Download in progress ...\");\n\t\tbarProgressDialog.setProgressStyle(barProgressDialog.STYLE_HORIZONTAL);\n\t\tbarProgressDialog.setProgress(0);\n\t\tbarProgressDialog.setMax(20);\n\t\tbarProgressDialog.show();\n\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\n\t\t\t\t\t\/\/ Here you should write your time consuming task...\n\t\t\t\t\twhile (barProgressDialog.getProgress() &lt;= barProgressDialog.getMax()) {\n\n\t\t\t\t\t\tThread.sleep(2000);\n\n\t\t\t\t\t\tupdateBarHandler.post(new Runnable() {\n\n                            public void run() {\n\n                            \tbarProgressDialog.incrementProgressBy(2);\n\n                              }\n\n                          });\n\n\t\t\t\t\t\tif (barProgressDialog.getProgress() == barProgressDialog.getMax()) {\n\n\t\t\t\t\t\t\tbarProgressDialog.dismiss();\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}).start();\n\t}\n}<\/pre>\n<p>The&nbsp;<code>Handler&nbsp;<\/code>component is a very interesting feature. Take a look at the&nbsp;<a href=\"http:\/\/developer.android.com\/reference\/android\/os\/Handler.html\">Android Handler Documentation<\/a>.<\/p>\n<h3>5. Run the application<\/h3>\n<p>This is the main screen of our Application:<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-screen17.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4019\" alt=\"main-screen\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-screen17.jpg\" width=\"256\" height=\"470\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-screen17.jpg 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/main-screen17-163x300.jpg 163w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<p>Now, when you press the &#8220;ProgressDialog Bar&#8221; button :<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-bar.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4017\" alt=\"progress-bar\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-bar.jpg\" width=\"256\" height=\"470\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-bar.jpg 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-bar-163x300.jpg 163w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<p>And after some time, the download is completed and the Progress Bar Dialog will close automatically\u2026 And when you press the &#8220;ProgressDialog Ring&#8221;:<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-ring.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-4018\" alt=\"progress-ring\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-ring.jpg\" width=\"256\" height=\"470\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-ring.jpg 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/progress-ring-163x300.jpg 163w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<h3>Download Eclipse Project<\/h3>\n<p>This was an Android ProgressDialog Example. Download the Eclipse Project of this tutorial:&nbsp;<a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/05\/AndroidProgressDialogExample.zip\">AndroidProgressDialogExample.zip<\/a><a href=\"http:\/\/jcg-examples.javacodegeeks.netdna-cdn.com\/wp-content\/uploads\/2013\/01\/AndroidProgressBarExample.zip\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of time, for example a file or an Image download. In this tutorial will create a ProgressDialog to let the user know the progress and a status of &hellip;<\/p>\n","protected":false},"author":4,"featured_media":1202,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[450],"tags":[],"class_list":["post-4009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-progressdialog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android ProgressDialog Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android ProgressDialog Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-29T22:17:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-09T08:17:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nikos Maravitsas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikos Maravitsas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\"},\"author\":{\"name\":\"Nikos Maravitsas\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/686a494fbb577a8d1231862b139cda6b\"},\"headline\":\"Android ProgressDialog Example\",\"datePublished\":\"2013-05-29T22:17:36+00:00\",\"dateModified\":\"2019-05-09T08:17:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\"},\"wordCount\":558,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"articleSection\":[\"ProgressDialog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\",\"name\":\"Android ProgressDialog Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"datePublished\":\"2013-05-29T22:17:36+00:00\",\"dateModified\":\"2019-05-09T08:17:42+00:00\",\"description\":\"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"core\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"ui\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/ui\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"ProgressDialog\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/ui\/progressdialog\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Android ProgressDialog Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/686a494fbb577a8d1231862b139cda6b\",\"name\":\"Nikos Maravitsas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Nikos-Maravitsas-80x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Nikos-Maravitsas-80x96.jpg\",\"caption\":\"Nikos Maravitsas\"},\"description\":\"Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. During his studies he discovered his interests about software development and he has successfully completed numerous assignments in a variety of fields. Currently, his main interests are system\u2019s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human \u2013 machine interaction and mobile development.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/nikos-maravitsas\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android ProgressDialog Example - Java Code Geeks","description":"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/","og_locale":"en_US","og_type":"article","og_title":"Android ProgressDialog Example - Java Code Geeks","og_description":"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of","og_url":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-05-29T22:17:36+00:00","article_modified_time":"2019-05-09T08:17:42+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","type":"image\/jpeg"}],"author":"Nikos Maravitsas","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Nikos Maravitsas","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/"},"author":{"name":"Nikos Maravitsas","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/686a494fbb577a8d1231862b139cda6b"},"headline":"Android ProgressDialog Example","datePublished":"2013-05-29T22:17:36+00:00","dateModified":"2019-05-09T08:17:42+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/"},"wordCount":558,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","articleSection":["ProgressDialog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/","url":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/","name":"Android ProgressDialog Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","datePublished":"2013-05-29T22:17:36+00:00","dateModified":"2019-05-09T08:17:42+00:00","description":"Progress dialogs are very commonly used components in all User Interfaces, when you want to display the progress of a task that is taking up a lot of","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/ui\/progressdialog\/android-progressdialog-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/"},{"@type":"ListItem","position":3,"name":"core","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/"},{"@type":"ListItem","position":4,"name":"ui","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/ui\/"},{"@type":"ListItem","position":5,"name":"ProgressDialog","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/ui\/progressdialog\/"},{"@type":"ListItem","position":6,"name":"Android ProgressDialog Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/686a494fbb577a8d1231862b139cda6b","name":"Nikos Maravitsas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Nikos-Maravitsas-80x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/10\/Nikos-Maravitsas-80x96.jpg","caption":"Nikos Maravitsas"},"description":"Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. During his studies he discovered his interests about software development and he has successfully completed numerous assignments in a variety of fields. Currently, his main interests are system\u2019s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human \u2013 machine interaction and mobile development.","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/nikos-maravitsas\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/4009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=4009"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/4009\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1202"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=4009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=4009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=4009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}