Because you're not truly creating a thread unless you call Thread.start
().  Thread.run() will just do the runnable part in your current
thread, which is, with certainty, not what you intended to do :)

On Jun 3, 6:50 pm, pawpaw17 <georgefraz...@yahoo.com> wrote:
> I have code in my activity's onCreate that sets an onItemClick
> listener.
> when it fires I try to show a ProgressDialog that will be up until a
> subsequent
> thread "Thread" does it's processing.  Strangely to me, the progress
> dialog
> never shows until *after* the thread.run() processing is complete.
> Almost like it's
> blocking. Am I doing something wrong? this is true even if the run
> method of doCurrentLocation
> doesn't do anything.
>
> Thanks for any ideas!! pawpaw17
>
> @Override
> public void onCreate(Bundle savedInstanceState) {
>   super.onCreate(savedInstanceState);
> ...
>   optionsList.setOnItemClickListener(new OnItemClickListener(){
>
>         public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
>                                         long arg3) {
>
>         pd = ProgressDialog.show(myContext, getString
> (R.string.app_name), getString(R.string.thousands), true,
>                 false);
>           Thread thread = new Thread(null, doGetCurrentLocation,
> "Background");
>           thread.run();
>       };
>   });
>   ...
>
> };
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to