how can i call a throwable method inside a runnable, for creating a new thread
<p>while trying to create a progressbar in android i came across this problem.
i am following this example : <a href="http://developer.android.com/reference/android/widget/ProgressBar.html" rel="nofollow">http://developer.android.com/reference/android/widget/ProgressBar.html</a></p>

<p>my problem is that one of my methods i want to call has to be inside a try and catch
how do i do that inside of a runnable?</p>

<pre><code>Runnable SendThread = new Runnable() 
{
    try 
    {
        GetAndConvertImagesToPdf();
        mProgStatus = 30;
        mProgress.setProgress(mProgStatus);
        title.setText(R.string.sendingTitle);

    } 
    catch (DocumentException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } 
    catch (IOException e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
};
</code></pre>

<p>i get this error: </p>

<p>"Syntax error on token try, delete this token"</p>

<p>how can i resolve this?</p>

<p>thank you</p>
