Skip to content

Instantly share code, notes, and snippets.

@cutiko
Forked from patrickhammond/gist:0b13ec35160af758d98c
Last active November 2, 2017 19:39
Show Gist options
  • Save cutiko/3b256fed0afe07d4d012b3d68a068fc9 to your computer and use it in GitHub Desktop.
Save cutiko/3b256fed0afe07d4d012b3d68a068fc9 to your computer and use it in GitHub Desktop.
Cómo arreglar el problema de SSL con retrofit
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