0

So far I've only bothered supporting Android API 11 and above, but this app is super simple, so I thought I'd try supporting down to 8. Eclipse only has one complaint, and that's my onCreateView method. How do I handle this without raising my minSDK version?

@Override
public View onCreateView(View parent, String name, Context context,
        AttributeSet attrs) {
    // TODO Auto-generated method stub
    return super.onCreateView(parent, name, context, attrs);  //complains here
}
NSouth
  • 5,067
  • 7
  • 48
  • 83
  • Possible duplicate of [Call requires API level 11(current min is 8) android.app.Activity#onCreateView](http://stackoverflow.com/questions/32181705/call-requires-api-level-11current-min-is-8-android-app-activityoncreateview) – Murmel Oct 18 '15 at 21:32
  • I think your problem belongs to a bug, because there are 3 other SO-Threads with the same problem. Bug-Report is already open: https://code.google.com/p/android/issues/detail?id=188677 – Murmel Oct 18 '15 at 21:35

1 Answers1

1

Override the three-parameter version of onCreateView() instead, dropping View parent.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I thought about that. So that wouldn't break support for newer Android versions? – NSouth Sep 05 '14 at 00:13
  • @NSouth: Looking at the `Activity` and `LayoutInflater` source code, you might need to override both. The only time I see both being invoked on the same device would be for a `` tag, where the four-parameter version chains to the three-parameter version for some reason. To be honest, in ~6 years of Android development, I have never had the need to override this method. – CommonsWare Sep 05 '14 at 10:29