android - Checking for google play services -
it drives me crazy how important documentation overlooked in google docs. have plucked out hair if wasn't bald already.
private void checkgoogleplayservices() { int errorcode = googleapiavailability.getinstance().isgoogleplayservicesavailable(this); boolean iserrorresolvable = googleapiavailability.getinstance().isuserresolvableerror(errorcode); if (iserrorresolvable) { googleapiavailability.getinstance().geterrordialog(this, errorcode, request_code_google_play_services).show(); } else { if (errorcode == connectionresult.success) { launchapplication(); } } }
the above code displays dialog box says has button reading get google play services:
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == request_code_google_play_services) { } }
now should here ? how should direct user play store update playservices? deem geterrorresolutionpendingintent
of use here, not sure how go this.
please aid me.
you can use code open google play service page on app store:
try { startactivity(new intent(intent.action_view, uri.parse("market://details?id=" + googleapiavailability.google_play_services_package))); } catch (android.content.activitynotfoundexception anfe) { startactivity(new intent(intent.action_view, uri.parse("https://play.google.com/store/apps/details?id=" + googleapiavailability.google_play_services_package))); }
Comments
Post a Comment