There's an example of how to do loading in a separate thread on the Android developer's website. To see the actual code, expand the view at the end of the section on Progress Dialogs.
However, for your particular situation, you need to rework how you're doing things. What is taking so long that you need a progress dialog for it? You should load that in the 2nd thread, while displaying some kind of temporary layout with setContentView. Then once the thread finishes loading, either call setContentView again, or change the text, images or whatever that you loaded with the thread.
Lastly: If you're really new to programming in Android, I'd avoid trying to use separate threads and complicated loading things for now. It's a bit tricky to do and there's a lot to understand first.