It is a bad practice to write code with so many levels of nesting, especially in try-catch - so I would say: avoid. On the other hand throwing an exception from catch block is unforgivable sin, so you should be very careful.

My advice - extract your catch logic into a method (so catch block is simple) and make sure this method will never throw anything:

Also it seems (I might be wrong) that you are using exceptions to control program flow. Consider standard return value if throwing ActivityNotFoundException is not an exceptional situation but it might happen under normal circumstances.

thanks...why do you say throwing an exception in a try/catch is a sin? :)
–
GeekedOutMay 20 '12 at 14:59

1

"So many levels?" I see a grand total of three. His logic in the catch block is no deeper than an if block in his try block would be.
–
T.J. CrowderMay 20 '12 at 15:00

The problem I saw with breaking it up is that I don't know how to check for the condition of whether the exception will happen or not since I am trying to go to an external url.
–
GeekedOutMay 20 '12 at 15:00

@GeekedOut: It's the handling that you might extract into a function. But see also Tomasz's just-added point about using exceptions to control program flow (an anti-pattern), which is a good point.
–
T.J. CrowderMay 20 '12 at 15:01

1

@GeekedOut: because I thought about finally block, not catch block. There is nothing wrong with throwing from catch, throwing from finally is a terrible idea because if finally was called due to an exception, throwing another exception will discard the original one. Sorry, I removed this part.
–
Tomasz NurkiewiczMay 20 '12 at 15:02