What method should I call to know if an Activity has its contentView (once the method setContentView() has been called)?
There is no "isContentViewSet" method. You may put some dummy requestWindowFeature call into try/catch block before setContentView like this:
try {
requestWindowFeature(Window.FEATURE_CONTEXT_MENU);
setContentView(...)
} catch (AndroidRuntimeException e) {
// do smth or nothing
}
If content view was already set, requestWindowFeature will throw an exception.