I have a project for HoneyComb and I get an error after use recreate() method at onResum() method in my main Activity.
11-10 22:05:42.090: E/ActivityThread(1917)
To do this, use a handler:
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
if(msg.what==MSG_RECREATE)
recreate();
}
};
@Override
protected void onResume() {
if(condition) {
Message msg = handler.obtainMessage();
msg.what = MSG_RECREATE;
handler.sendMessage(msg);
}
}
This will not crash anymore.