IllegalStateException: The application’s PagerAdapter changed the adapter’s content without calling PagerAdapter#notifyDataSetChanged

I had a hard time making my ViewPager working. At the end, it seems that the example in the documentation is wrong. The addTab method should be as follows: public void addTab(Tab tab, Class<?> clss, Bundle args) { TabInfo info = new TabInfo(clss, args); tab.setTag(info); tab.setTabListener(this); mTabs.add(info); notifyDataSetChanged(); mActionBar.addTab(tab); } Notice the order of the … Read more

java.lang.IllegalStateException:Could not find backup for factory javax.faces.application.ApplicationFactory

That may happen if your webapp’s runtime classpath is polluted with multiple JSF impls/versions. The org.apache.myfaces entries in the stack trace tells that you’re using MyFaces. This problem thus suggests that you’ve another JSF implementation like Mojarra in the webapp’s runtime classpath which is conflicting with it. It’s recognizable by jsf-api.jar, or jsf-impl.jar, or javax.faces.jar. … Read more

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

You should do the transaction in a Handler as follows: @Override protected void onPostExecute(String result) { Log.v(“MyFragmentActivity”, “onFriendAddedAsyncTask/onPostExecute”); new Handler().post(new Runnable() { public void run() { fm = getSupportFragmentManager(); ft = fm.beginTransaction(); ft.remove(dummyFragment); ft.commit(); } }); }

Rationale for Matcher throwing IllegalStateException when no ‘matching’ method is called

Actually, you misunderstood the documentation. Take a 2nd look at the statement you quoted: – attempting to query any part of it before a successful match will cause an IllegalStateException to be thrown. A matcher may throw IllegalStateException on accessing matcher.group() if no match was found. So, you need to use following test, to actually … Read more

Adding causes java.lang.IllegalStateException: Cannot create a session after the response has been committed

This is a known problem and has been reported by yours truly as issue 2215. This will occur when the response buffer has overflowed (due to large content) and the response is been committed before the session is been created. This is result of bit overzealous attempts of Mojarra to postpone “unnecessary” session creation as … Read more

IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager

Please check my answer here. Basically I just had to : @Override protected void onSaveInstanceState(Bundle outState) { //No call for super(). Bug on API Level > 11. } 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 … Read more

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: protected void doXxx() { if (someCondition) { sendRedirect(); } forward(); // This is STILL invoked when someCondition is … Read more

tech