1

Using the BitmapFactory.decodeStream function, I've got the following exception

02-22 13:24:34.129: W/System.err(7927): java.io.FileNotFoundException: toto.jpg

In the catch clause, a e.getMessage() produces

toto.jpg

But how the get the

java.io.FileNotFoundException 

I tried e.getCause() but it returns null

0

2 Answers 2

1

try :

exception.toString(); 

see the resource code , and you will understand

Sign up to request clarification or add additional context in comments.

2 Comments

Why toString! did ToString print the whole call stack?
No, it will print the name of exception , like "java.io.FileNotFoundException" . if you want to see the whole stack message , you should try exception.printStackTrace() or exception.getMessage()
0

Try:

/* ... */
catch(Exception e) {
    String name = e.getClass().getName();
}

1 Comment

It's not working : The method getName() is undefined for the type Exception

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.