morristech
4/30/2018 - 8:48 PM

ProviderInstaller.installIfNeeded

ProviderInstaller.installIfNeeded

public static void installServiceProviderIfNeeded(Context context) {
    try {
        ProviderInstaller.installIfNeeded(context);
    } catch (GooglePlayServicesRepairableException e) {
        e.printStackTrace();

        // Prompt the user to install/update/enable Google Play services.
        GooglePlayServicesUtil.showErrorNotification(e.getConnectionStatusCode(), context);

    } catch (GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }
}