ANDROID PLACE_PICKER (builder.build(context)

前端 未结 2 1900
陌清茗
陌清茗 2021-01-16 00:11

Basically I am trying to implement a PLACE_PICKER for Android and I am getting this confusing error here:

    int PLACE_PICKER_REQUEST = 1;
    PlacePicker.I         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 01:07

    For Fragment

               try {
                    int PLACE_PICKER_REQUEST = 1;
                    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
                    startActivityForResult(builder.build(getActivity()), PLACE_PICKER_REQUEST);
                }catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException ex){
                    ex.printStackTrace();
                }
    

提交回复
热议问题