Hi all,
im trying to surround my code with exceptions all over so I wont have any memory leaks. I tried the following code, and for some reason the exception isnt being handled and i get runtime error.
some code:
try
{
methodA();
} catch (Throwable th)
{
MsgProxyLogger.error(TAG, th.getMessage());
}
}
protected void methodA()
{
Thread disptacherThread = new Thread()
{
@Override
public void run()
{
dispatcher.dispatch(existingMessagesArr);
}
};
disptacherThread.start();
}
Now if some runtime exception occurse inside the thread, it wont be caught in the throable clauses ?
why is that? does Anonymous thread is canceling the catch clauses?
Thanks,
ray.