I'm developing my first Android apps in Android Studio 3.1.2.
I've noticed a strange quirk in Studio that has me puzzled. It's not a big deal but it is a bit annoying.
When I write a catch block for an exception, Studio only seems to allow for the variable name to be a single letter. For example, if I write:
Studio highlights my variable name, excp in red and leaves it in red (in both places). If I change it back to 'excp' back to 'e', the error goes away and all is well.
Studio lets me have multi-letter variable names everywhere else so I'm puzzled by why this would be a problem in a catch block. Is there a good reason for this or have I stumbled on a bug?
I avoid single-letter variables if at all possible, even in the simplest code. It's a bit of a personal quirk, I suppose, and it's not a big problem if I have to use single letter variables on occasion but I'd just like to know if Studio is working the way it is supposed to? It seems an odd thing to force on people.
I've noticed a strange quirk in Studio that has me puzzled. It's not a big deal but it is a bit annoying.
When I write a catch block for an exception, Studio only seems to allow for the variable name to be a single letter. For example, if I write:
Code:
try {
//something
}
catch (NullPointerException excp) {
excp.printStackTrace();
}
Studio highlights my variable name, excp in red and leaves it in red (in both places). If I change it back to 'excp' back to 'e', the error goes away and all is well.
Studio lets me have multi-letter variable names everywhere else so I'm puzzled by why this would be a problem in a catch block. Is there a good reason for this or have I stumbled on a bug?
I avoid single-letter variables if at all possible, even in the simplest code. It's a bit of a personal quirk, I suppose, and it's not a big problem if I have to use single letter variables on occasion but I'd just like to know if Studio is working the way it is supposed to? It seems an odd thing to force on people.