Android Android Places API edit

Adding more than one google auto complete activity.

public static final int PLACE_AUTOCOMPLETE_FROM_PLACE_REQUEST_CODE=1;
  public static final int PLACE_AUTOCOMPLETE_TO_PLACE_REQUEST_CODE=2;

fromPlaceEdit.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {

                   try {
                     //Do your stuff from place
                       startActivityForResult(intent, PLACE_AUTOCOMPLETE_FROM_PLACE_REQUEST_CODE);

                   } catch (GooglePlayServicesRepairableException e) {
                       // TODO: Handle the error.
                   } catch (GooglePlayServicesNotAvailableException e) {
                       // TODO: Handle the error.
                   }
               }
           });
toPlaceEdit.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {

               try {
                  //Do your stuff to place
                   startActivityForResult(intent, PLACE_AUTOCOMPLETE_TO_PLACE_REQUEST_CODE);

               } catch (GooglePlayServicesRepairableException e) {
                   // TODO: Handle the error.
               } catch (GooglePlayServicesNotAvailableException e) {
                   // TODO: Handle the error.
               }
           }
       });
@Override
   protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == PLACE_AUTOCOMPLETE_FROM_PLACE_REQUEST_CODE) {
          if (resultCode == RESULT_OK) {
             //Do your ok >from place< stuff here
          } else if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
             //Handle your error >from place<
          } else if (resultCode == RESULT_CANCELED) {
              // The user canceled the operation.
          }
      } else if (requestCode == PLACE_AUTOCOMPLETE_TO_PLACE_REQUEST_CODE) {
          if (resultCode == RESULT_OK) {
             //Do your ok >to place< stuff here
          } else if (resultCode == PlaceAutocomplete.RESULT_ERROR) {
             //Handle your error >to place<
          } else if (resultCode == RESULT_CANCELED) {
              // The user canceled the operation.
          }
       }
   }

Table Of Contents
39 ACRA
64 Menu
105 Android Places API
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close