Forked from patrickhammond/gist:0b13ec35160af758d98c
Last active
November 2, 2017 19:39
-
-
Save cutiko/3b256fed0afe07d4d012b3d68a068fc9 to your computer and use it in GitHub Desktop.
Cómo arreglar el problema de SSL con retrofit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.android.gms.common.GooglePlayServicesUtil; | |
import com.google.android.gms.security.ProviderInstaller; | |
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener; | |
public class SomeActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_some); | |
//This can also be done in a Fragment | |
upgradeSecurityProvider(); | |
} | |
private void upgradeSecurityProvider() { | |
//remember to add the library in your dependencies | |
//compile 'com.google.android.gms:play-services-base:11.0.0' | |
ProviderInstaller.installIfNeededAsync(this, new ProviderInstallListener() { | |
@Override | |
public void onProviderInstalled() { | |
//Do your http request here | |
} | |
@Override | |
public void onProviderInstallFailed(int errorCode, Intent recoveryIntent) { | |
//sad face :C is sad | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment