I know that the v4 support library can be used to implement things in older versions of Android that were introduced in later versions, such as fragments. If we implement an application that uses the v4 support library to display fragments of the dialog, for example, does it use the latest code (i.e. the source and new fragments) when it runs on ICS, or does it still use the support code for each version of Android ?
Is there a way to use the android.app.Fragment and android.support.v4.app.Fragment classes in one application that are different at run time if we run the Android version with Fragment support, or do we need to use only support classes when importing the v4 support library?
Maybe I'm wrong, but it does not seem to me a good idea not to use the latest code when working on the latest platforms.
Adhering to the case of a fragment of dialogue, what do you think is better:
1) use the v4 support library, i.e. use compatibility code for all versions of Android
2) use the new android.app.DialogFragment when working at API level 11 or higher and use the deprecated methods showDialog and onCreateDialog of the Activity class when working at API level <; eleven
As I said, the best IMHO would be the following, but (correct me if I am wrong) this is not a possible solution:
3) use the new class android.app.DialogFragment when working at API level 11 or higher and use the class android.support.v4.app.DialogFragment when starting at API level <11
I apologize if I am a little embarrassed, I hope that the question is completely clear.
android android-fragments android-dialogfragment android-support-library
Gianni costanzi
source share