1

My app is using Google Places API for Android. It's working fine to pick a place. But I also want a Bitmap snapshot from the Intent result. how can get the Bitmap from the Intent data?

 if (resultCode == Activity.RESULT_OK) {
            /* User has picked a place, extract data.
               Data is extracted from the returned intent by retrieving a Place object from
               the PlacePicker.
             */
            final Place place = PlacePicker.getPlace(data, getActivity());
}

 PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
            Intent intent = intentBuilder.build(getActivity());
            startActivityForResult(intent, REQUEST_PLACE_PICKER);
Joyofio987
  • 191
  • 1
  • 12

1 Answers1

0

Try to write a function that calls/executes a screenshot method after user is successful in picking a place. For example

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  if (requestCode == PLACE_PICKER_REQUEST) {
    if (resultCode == RESULT_OK) {
        Place place = PlacePicker.getPlace(data, this);
        String toastMsg = String.format("Place: %s", place.getName());
        Toast.makeText(this, toastMsg, Toast.LENGTH_LONG).show();

        executeScreenshot();

    }
  }
}

How to programmatically activate screenshot is discussed in this thread. It might help.

Community
  • 1
  • 1
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56