GetErrorDialog is depreciating. What is an updated function and how can I use it?

I am currently trying to enable the use of my API for Drive API.

The Google Developers Guide states that I should use getErrorDialog in the Connection Failure method.

However, when I put getErrorDialog in, it stated that the method was depreciated and that I needed to use the โ€œupdatedโ€ version.

However, he did not indicate what I should use instead.

Does anyone know an updated version of this feature?

+6
source share
1 answer

However, when I put getErrorDialog in, it stated that the method was depreciated and that I needed to use the โ€œupdatedโ€ version.

GooglePlayServicesUtil.getErrorDialog deprecated in favor of GoogleApiAvailability.getErrorDialog , which is not a static method, as it was for GooglePlayServicesUtil . You can get a copy of GoogleApiAvailability this way

 GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance(); 

and call getErrorDialog on the returned instance

 apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST).show(); 

where is the Context object and resultCode is the returned value of isGooglePlayServicesAvailable(Context) . You can read about it here.

+14
source

All Articles