Tabnine Logo
GooglePlayServicesRepairableException
Code IndexAdd Tabnine to your IDE (free)

How to use
GooglePlayServicesRepairableException
in
com.google.android.gms.common

Best Java code snippets using com.google.android.gms.common.GooglePlayServicesRepairableException (Showing top 10 results out of 315)

origin: DaxiaK/MyDiary

private void openGooglePlacePicker() {
  try {
    progressDialog.show();
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    startActivityForResult(builder.build(getActivity()), PLACE_PICKER_REQUEST);
  } catch (GooglePlayServicesRepairableException e) {
    e.printStackTrace();
    Toast.makeText(getActivity(), getString(R.string.toast_google_service_not_work), Toast.LENGTH_LONG).show();
    progressDialog.dismiss();
  } catch (GooglePlayServicesNotAvailableException e) {
    e.printStackTrace();
    Toast.makeText(getActivity(), getString(R.string.toast_google_service_not_work), Toast.LENGTH_LONG).show();
    progressDialog.dismiss();
  }
}
origin: chat-sdk/chat-sdk-android

public void startChooseLocationActivity (Activity activity, Result resultHandler) throws Exception {
  this.resultHandler = resultHandler;
  this.activity = activity;
  PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
  try {
    Intent intent = builder.build(activity);
    activity.startActivityForResult(intent, PICK_LOCATION);
  }
  catch (GooglePlayServicesRepairableException e) {
    throw new Exception(e.getMessage());
  }
  // Intent intent = new Intent(context, ChatSDKLocationActivity.class);
}
origin: Sishin/MapLocation

private void openAutocompleteActivity() {
  try {
    // The autocomplete activity requires Google Play Services to be available. The intent
    // builder checks this and throws an exception if it is not the case.
    Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN)
        .build(this);
    startActivityForResult(intent, REQUEST_CODE_AUTOCOMPLETE);
  } catch (GooglePlayServicesRepairableException e) {
    // Indicates that Google Play Services is either not installed or not up to date. Prompt
    // the user to correct the issue.
    GoogleApiAvailability.getInstance().getErrorDialog(this, e.getConnectionStatusCode(),
        0 /* requestCode */).show();
  } catch (GooglePlayServicesNotAvailableException e) {
    // Indicates that Google Play Services is not available and the problem is not easily
    // resolvable.
    String message = "Google Play Services is not available: " +
        GoogleApiAvailability.getInstance().getErrorString(e.errorCode);
    Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
  }
}
origin: googlesamples/android-play-places

private void openAutocompleteActivity() {
  try {
    // The autocomplete activity requires Google Play Services to be available. The intent
    // builder checks this and throws an exception if it is not the case.
    Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN)
        .build(this);
    startActivityForResult(intent, REQUEST_CODE_AUTOCOMPLETE);
  } catch (GooglePlayServicesRepairableException e) {
    // Indicates that Google Play Services is either not installed or not up to date. Prompt
    // the user to correct the issue.
    GoogleApiAvailability.getInstance().getErrorDialog(this, e.getConnectionStatusCode(),
        0 /* requestCode */).show();
  } catch (GooglePlayServicesNotAvailableException e) {
    // Indicates that Google Play Services is not available and the problem is not easily
    // resolvable.
    String message = "Google Play Services is not available: " +
        GoogleApiAvailability.getInstance().getErrorString(e.errorCode);
    Log.e(TAG, message);
    Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
  }
}
origin: ac-pm/Inspeckage

@Override
protected String doInBackground(Void... params) {
  AdvertisingIdClient.Info idInfo = null;
  try {
    idInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());
  } catch (GooglePlayServicesNotAvailableException e) {
    e.printStackTrace();
  } catch (GooglePlayServicesRepairableException e) {
    e.printStackTrace();
  } catch (Exception e) {
    e.printStackTrace();
  }
  String advertId = null;
  try{
    advertId = idInfo.getId();
  }catch (Exception e){
    e.printStackTrace();
  }
  return advertId;
}
@Override
origin: googlesamples/android-play-places

@Override
public void onCardClick(int cardActionId, String cardTag) {
  if (cardActionId == ACTION_PICK_PLACE) {
    // BEGIN_INCLUDE(intent)
    /* Use the PlacePicker Builder to construct an Intent.
    Note: This sample demonstrates a basic use case.
    The PlacePicker Builder supports additional properties such as search bounds.
     */
    try {
      PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
      Intent intent = intentBuilder.build(getActivity());
      // Start the Intent by requesting a result, identified by a request code.
      startActivityForResult(intent, REQUEST_PLACE_PICKER);
      // Hide the pick option in the UI to prevent users from starting the picker
      // multiple times.
      showPickAction(false);
    } catch (GooglePlayServicesRepairableException e) {
      GooglePlayServicesUtil
          .getErrorDialog(e.getConnectionStatusCode(), getActivity(), 0);
    } catch (GooglePlayServicesNotAvailableException e) {
      Toast.makeText(getActivity(), "Google Play Services is not available.",
          Toast.LENGTH_LONG)
          .show();
    }
    // END_INCLUDE(intent)
  }
}
origin: mitchtabian/Google-Maps-Google-Places

  @Override
  public void onClick(View view) {
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    try {
      startActivityForResult(builder.build(MapActivity.this), PLACE_PICKER_REQUEST);
    } catch (GooglePlayServicesRepairableException e) {
      Log.e(TAG, "onClick: GooglePlayServicesRepairableException: " + e.getMessage() );
    } catch (GooglePlayServicesNotAvailableException e) {
      Log.e(TAG, "onClick: GooglePlayServicesNotAvailableException: " + e.getMessage() );
    }
  }
});
origin: DaxiaK/MyDiary

private void openGooglePlacePicker() {
  if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getContext()) == ConnectionResult.SUCCESS) {
    try {
      progressDialog.show();
      PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
      startActivityForResult(builder.build(getActivity()), PLACE_PICKER_REQUEST);
    } catch (GooglePlayServicesRepairableException e) {
      e.printStackTrace();
      progressDialog.dismiss();
    } catch (GooglePlayServicesNotAvailableException e) {
      e.printStackTrace();
      progressDialog.dismiss();
    }
  } else {
    Toast.makeText(getActivity(), getString(R.string.toast_google_service_not_work), Toast.LENGTH_LONG).show();
  }
}
origin: Attriumph/Place-Search-Service

@Override
public void afterTextChanged(Editable s) {
  String location = s.toString();
  if (TextUtils.isEmpty(location)) return;
  if (location.equals(oldLocation)) return;
  try {
    Intent build = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN).zzh(s.toString()).
        build((Activity) context);
    startActivityForResult(build, AUTO_COMP_REQ_CODE);
  } catch (GooglePlayServicesRepairableException e) {
    e.printStackTrace();
  } catch (GooglePlayServicesNotAvailableException e) {
    e.printStackTrace();
  }
  oldLocation = location;
}
origin: rajeeviiit/AndroidProject

  startActivityForResult(builder.build(getActivity()), PLACE_PICKER_REQUEST);
} catch (GooglePlayServicesRepairableException e) {
  e.printStackTrace();
} catch (GooglePlayServicesNotAvailableException e) {
  e.printStackTrace();
com.google.android.gms.commonGooglePlayServicesRepairableException

Most used methods

  • printStackTrace
  • getConnectionStatusCode
  • getMessage

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • findViewById (Activity)
  • setContentView (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now