当前位置: 首页>>代码示例>>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;未经允许,请勿转载。