當前位置: 首頁>>代碼示例>>Java>>正文


Java GooglePlayServicesNotAvailableException類代碼示例

本文整理匯總了Java中com.google.android.gms.common.GooglePlayServicesNotAvailableException的典型用法代碼示例。如果您正苦於以下問題:Java GooglePlayServicesNotAvailableException類的具體用法?Java GooglePlayServicesNotAvailableException怎麽用?Java GooglePlayServicesNotAvailableException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GooglePlayServicesNotAvailableException類屬於com.google.android.gms.common包,在下文中一共展示了GooglePlayServicesNotAvailableException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selectCity

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
@OnClick(R.id.weather_city)
public void selectCity() {

    //restrict to cities
    AutocompleteFilter cityFilter = new AutocompleteFilter.Builder()
            .setTypeFilter(AutocompleteFilter.TYPE_FILTER_CITIES)
            .build();
    try {
        Intent intent =
                new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
                        .setFilter(cityFilter)
                        .build(getActivity());
        startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        // TODO: Handle the error.
    }
}
 
開發者ID:dan-silver,項目名稱:cast-dashboard-android-app,代碼行數:18,代碼來源:WeatherSettings.java

示例2: parseString

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public static String parseString(Context context, String clickUrl) throws IOException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {

            String deviceId = android.provider.Settings.Secure.getString(Aptoide.getContext().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
            String myid = PreferenceManager.getDefaultSharedPreferences(context).getString(EnumPreferences.APTOIDE_CLIENT_UUID.name(), "NoInfo");

            if (deviceId != null) {
                clickUrl = clickUrl.replace("[USER_ANDROID_ID]", deviceId);
            }

            if (myid != null) {
                clickUrl = clickUrl.replace("[USER_UDID]", myid);
            }

            clickUrl = replaceAdvertisementId(clickUrl, context);
            clickUrl = clickUrl.replace("[TIME_STAMP]", String.valueOf(new Date().getTime()));

            return clickUrl;
        }
 
開發者ID:Aptoide,項目名稱:aptoide-client,代碼行數:19,代碼來源:AptoideUtils.java

示例3: onWaypointTitleClick

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
@OnClick(R.id.reminder_item_waypoint_title_text_view)
public void onWaypointTitleClick() {
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    if (mRemindItem.getWaypoint() != null) {
        LocationPoint locationPoint = mRemindItem.getWaypoint().getLocation();
        LatLng latLng = new LatLng(locationPoint.getLatitude(), locationPoint.getLongitude());
        LatLngBounds latLngBounds = new LatLngBounds(latLng, latLng);
        builder.setLatLngBounds(latLngBounds);
    }

    Intent intent = null;
    try {
        intent = builder.build(getActivity());
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }
    mProgressDialog = ProgressDialog.show(mContext,
            getString(R.string.reminder_place_picker_progress_dialog_title),
            getString(R.string.reminder_place_picker_progress_dialog_message), true, false);
    startActivityForResult(intent, PLACE_PICKER_REQUEST);
}
 
開發者ID:trigor74,項目名稱:travelers-diary,代碼行數:22,代碼來源:ReminderItemFragment.java

示例4: onCreate

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_place_picker);
    mName = (TextView) findViewById(R.id.textView);
    mAddress = (TextView) findViewById(R.id.textView2);
    mAttributions = (TextView) findViewById(R.id.textView3);
    Button pickerButton = (Button) findViewById(R.id.pickerButton);
    pickerButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {
                PlacePicker.IntentBuilder intentBuilder =
                        new PlacePicker.IntentBuilder();
                intentBuilder.setLatLngBounds(BOUNDS_MOUNTAIN_VIEW);
                Intent intent = intentBuilder.build(PlacePickerActivity.this);
                startActivityForResult(intent, PLACE_PICKER_REQUEST);

            } catch (GooglePlayServicesRepairableException
                    | GooglePlayServicesNotAvailableException e) {
                e.printStackTrace();
            }
        }
    });
}
 
開發者ID:Truiton,項目名稱:PlacePicker,代碼行數:26,代碼來源:PlacePickerActivity.java

示例5: Endpoint

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
/**
 * Constructor.
 *
 * @param context The Context to use
 */
Endpoint(@NonNull Context context) {
    try {
        ProviderInstaller.installIfNeeded(context);
    } catch(GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        Log.e(TAG, e.getMessage(), e);
    }

    mContext = context;

    final OkHttpClient.Builder builder = new OkHttpClient.Builder()
            .connectTimeout(30, TimeUnit.SECONDS);
    configureSSL(builder);
    mClient = builder.build();

    final String apiUri =
            context.getString(BuildConfig.DEBUG ? R.string.api_url_debug : R.string.api_url);
    mBaseUrl = HttpUrl.parse(apiUri).newBuilder()
            .addEncodedPathSegment(getName())
            .build();
    mUserAgent = context.getString(R.string.user_agent, BuildConfig.VERSION_NAME);

    loadAuthToken();
}
 
開發者ID:ultramega,項目名稱:flavordex,代碼行數:29,代碼來源:Endpoint.java

示例6: onOptionsItemSelected

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.action_search) {
        // Method #3
        try {
            Intent intent = new PlaceAutocomplete.IntentBuilder
                    (PlaceAutocomplete.MODE_OVERLAY)
                    .setBoundsBias(BOUNDS_MOUNTAIN_VIEW)
                    .build(MainActivity.this);
            startActivityForResult(intent, REQUEST_SELECT_PLACE);
        } catch (GooglePlayServicesRepairableException |
                GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
開發者ID:Truiton,項目名稱:PlaceApiAutocompleteWidget,代碼行數:20,代碼來源:MainActivity.java

示例7: installIfNeededAsync

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public static void installIfNeededAsync(Context paramContext, final ProviderInstallListener paramProviderInstallListener)
{
  zzx.zzb(paramContext, "Context must not be null");
  zzx.zzb(paramProviderInstallListener, "Listener must not be null");
  zzx.zzcx("Must be called on the UI thread");
  new AsyncTask()
  {
    private Integer zzc$9ecd34e()
    {
      try
      {
        ProviderInstaller.installIfNeeded(this.zzsR);
        return Integer.valueOf(0);
      }
      catch (GooglePlayServicesRepairableException localGooglePlayServicesRepairableException)
      {
        return Integer.valueOf(localGooglePlayServicesRepairableException.zzVA);
      }
      catch (GooglePlayServicesNotAvailableException localGooglePlayServicesNotAvailableException)
      {
        return Integer.valueOf(localGooglePlayServicesNotAvailableException.errorCode);
      }
    }
  }.execute(new Void[0]);
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:26,代碼來源:ProviderInstaller.java

示例8: Bundle

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public static PendingIntent getRecoveryIfSuggested$12f08959(Context paramContext, String paramString)
  throws IOException, UserRecoverableAuthException, GoogleAuthException
{
  zzx.zzcy("Calling this from your main thread can lead to deadlock");
  try
  {
    GooglePlayServicesUtil.zzae(paramContext.getApplicationContext());
    final Bundle localBundle = new Bundle();
    localBundle.putString(KEY_ANDROID_PACKAGE_NAME, paramContext.getPackageName());
    zza local3 = new zza() {};
    RecoveryDecision localRecoveryDecision = (RecoveryDecision)zza(paramContext, zzVm, local3);
    if ((localRecoveryDecision.showRecoveryInterstitial) && (localRecoveryDecision.isRecoveryInterstitialAllowed)) {
      return localRecoveryDecision.recoveryIntent;
    }
  }
  catch (GooglePlayServicesRepairableException localGooglePlayServicesRepairableException)
  {
    throw new GooglePlayServicesAvailabilityException(localGooglePlayServicesRepairableException.zzVA, localGooglePlayServicesRepairableException.getMessage(), new Intent(localGooglePlayServicesRepairableException.mIntent));
  }
  catch (GooglePlayServicesNotAvailableException localGooglePlayServicesNotAvailableException)
  {
    throw new GoogleAuthException(localGooglePlayServicesNotAvailableException.getMessage());
  }
  return null;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:26,代碼來源:GoogleAuthUtil.java

示例9: zzb

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public void zzb(boolean paramBoolean)
  throws IOException, IllegalStateException, GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException
{
  zzx.zzcy("Calling this from your main thread can lead to deadlock");
  try
  {
    if (this.zzpg) {
      finish();
    }
    this.zzpe = zzq(this.mContext);
    this.zzpf = zza$4541938d(this.zzpe);
    this.zzpg = true;
    if (paramBoolean) {
      zzaW();
    }
    return;
  }
  finally {}
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:20,代碼來源:AdvertisingIdClient.java

示例10: zzY

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
private static zzjz zzY(Context paramContext)
  throws GooglePlayServicesNotAvailableException
{
  synchronized (zzqK)
  {
    if (zzNn == null)
    {
      if (paramContext.getApplicationContext() != null) {
        paramContext = paramContext.getApplicationContext();
      }
      zzNn = zzjy.zzaa(paramContext);
    }
    zzjz localzzjz = zzNn;
    return localzzjz;
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:17,代碼來源:GmpMeasurement.java

示例11: initializeMap

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
private void initializeMap() throws GooglePlayServicesNotAvailableException {
	try {
		MapsInitializer.initialize(getActivity());
		if (getActivity().getSupportFragmentManager().findFragmentById(
				R.id.mapContainer) == null) {
			mapSupportFragment = MySupportMapFragment
					.newInstatnce(new Bundle());
			mapSupportFragment.setTargetFragment(this, 100);
			if (getArguments() != null)
				mapSupportFragment.setArguments(getArguments());

			getActivity().getSupportFragmentManager().beginTransaction()
					.add(R.id.mapContainer, mapSupportFragment).commit();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:himanshuagarwal77225,項目名稱:BookMySkills,代碼行數:19,代碼來源:MyHomeFragment.java

示例12: onPickEventPlaceClick

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
/**
 * Pick place
 * https://medium.com/@hitherejoe/exploring-play-services-place-picker-autocomplete-150809f739fe
 */
@Override
public void onPickEventPlaceClick() {
    PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
    if(editEventDataModel.getEvent().hasLocation()) {
        double longitude = editEventDataModel.getEvent().getLongitude();
        double latitude = editEventDataModel.getEvent().getLatitude();
        double offset = 0.01;
        LatLng southwest = new LatLng(latitude - offset, longitude - offset);
        LatLng northeast = new LatLng(latitude + offset, longitude + offset);
        intentBuilder.setLatLngBounds(new LatLngBounds(southwest, northeast));
    }
    try {
        startActivityForResult(intentBuilder.build(this), PLACE_PICKER_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
        Toast.makeText(this, getString(R.string.unknown_error), Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:23,代碼來源:EditEventActivity.java

示例13: m

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
private static void m(Context paramContext)
{
  try
  {
    GooglePlayServicesUtil.m(paramContext);
    return;
  }
  catch (GooglePlayServicesRepairableException localGooglePlayServicesRepairableException)
  {
    throw new GooglePlayServicesAvailabilityException(localGooglePlayServicesRepairableException.getConnectionStatusCode(), localGooglePlayServicesRepairableException.getMessage(), localGooglePlayServicesRepairableException.getIntent());
  }
  catch (GooglePlayServicesNotAvailableException localGooglePlayServicesNotAvailableException)
  {
    throw new GoogleAuthException(localGooglePlayServicesNotAvailableException.getMessage());
  }
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:17,代碼來源:GoogleAuthUtil.java

示例14: initialize

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public static int initialize(Context paramContext)
{
  eg.f(paramContext);
  c localc;
  try
  {
    localc = q.u(paramContext);
  }
  catch (GooglePlayServicesNotAvailableException localGooglePlayServicesNotAvailableException)
  {
    return localGooglePlayServicesNotAvailableException.errorCode;
  }
  try
  {
    CameraUpdateFactory.a(localc.ez());
    BitmapDescriptorFactory.a(localc.eA());
  }
  catch (RemoteException localRemoteException)
  {
    throw new RuntimeRemoteException(localRemoteException);
  }
  return 0;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:24,代碼來源:MapsInitializer.java

示例15: updateAdvertisingId

import com.google.android.gms.common.GooglePlayServicesNotAvailableException; //導入依賴的package包/類
public void updateAdvertisingId() {

        new Thread(new Runnable() {
            @Override
            public void run() {
                AdvertisingIdClient.Info adInfo = null;
                try {
                    adInfo = AdvertisingIdClient.getAdvertisingIdInfo(TweetingActivity.this);

                } catch (IOException | GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException exception) {
                    // Unrecoverable error connecting to Google Play services (e.g.,
                    // the old version of the service doesn't support getting AdvertisingId).

                }
                if (adInfo != null) {
                    mAdversitingId = adInfo.getId();
                }
            }
        });
    }
 
開發者ID:HugoGresse,項目名稱:TweetyHunting,代碼行數:21,代碼來源:TweetingActivity.java


注:本文中的com.google.android.gms.common.GooglePlayServicesNotAvailableException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。