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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -