Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.1.0-alpha01

PackageInfoCompat

public final class PackageInfoCompat
extends Object

java.lang.Object
   ↳ androidx.core.content.pm.PackageInfoCompat


Helper for accessing features in PackageInfo.

Summary

Public methods

static long getLongVersionCode(PackageInfo info)

Return R.attr.versionCode and R.attr.versionCodeMajor combined together as a single long value.

Inherited methods

Public methods

getLongVersionCode

added in version 1.0.0
public static long getLongVersionCode (PackageInfo info)

Return R.attr.versionCode and R.attr.versionCodeMajor combined together as a single long value. The versionCodeMajor is placed in the upper 32 bits on Android P or newer, otherwise these bits are all set to 0.

Parameters
info PackageInfo

Returns
long