java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed

A common misunderstanding among starters is that they think that the call of a forward(), sendRedirect(), or sendError() would magically exit and “jump” out of the method block, hereby ignoring the remnant of the code. For example: This is thus actually not true. They do certainly not behave differently than any other Java methods (expect … Read more

IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager

Please check my answer here. Basically I just had to : Don’t make the call to super() on the saveInstanceState method. This was messing things up… This is a known bug in the support package. If you need to save the instance and add something to your outState Bundle you can use the following: In the end the proper solution was (as seen in the … Read more

What is IllegalStateException?

Usually, IllegalStateException is used to indicate that “a method has been invoked at an illegal or inappropriate time.” However, this doesn’t look like a particularly typical use of it. The code you’ve linked to shows that it can be thrown within that code at line 259 – but only after dumping a SQLException to standard output. We can’t tell what’s wrong … Read more