I just upgraded my app's compileSdkVersion
to 28
(Pie).
I'm getting a compilation warning:
warning: [deprecation] versionCode in PackageInfo has been deprecated
The warning is coming from this code:
final PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
int versionCode = info.versionCode;
I looked at the documentation, but it doesn't say anything about how to resolve this issue or what should be used instead of the deprecated field.