Before posting my question. i looked this one stack overflow.and wann know, is it really impossible? i have app developed in android 2.2 with the use of compatibility library v4. which is also compatible with android 3.0 device. and i want my app to use android compatibility library v4 if device is android 2.x and native library if device is android 3.x. any suggestion??
thanks in advance
I haven't tried what I'm recommending, but it could work:
For this to work, you'll need to use fully qualified names in your code, instead of having import statements on the top. So for Fragments on 3.0 and above, you'd use:
android.app.Fragment fragment;
instead of:
Fragment fragment;
and an import statement on top. And finally for pre 3.0, you'd need statements like:
android.support.v4.app.Fragment fragment;
You need to use these names as you cannot import both version and use only one.