22

I'm trying to develop an application based on google place API. When I try to use

Place place=PlacePicker.getPlace(data,this);

there is an error showing getPlace() is deprecated. Please suggest a solution. Thanks in advance!

tynn
  • 38,113
  • 8
  • 108
  • 143
Sai Raman Kilambi
  • 878
  • 2
  • 12
  • 29
  • Google is tracking the interest in having a Place Picker widget here: (Android) https://issuetracker.google.com/128304810, (iOS) https://issuetracker.google.com/128304760. Please fill the linked form with your use case and needs if you are interested. – Daffi Mar 13 '19 at 09:14

1 Answers1

46

The documentation states

This method is deprecated.
Use getPlace(Context, Intent) instead.

You should find this information in Android Studio as well.

tynn
  • 38,113
  • 8
  • 108
  • 143
  • 7
    For those who didn't realise (like me), the Context and the Intent have been switched, so if you have a deprecation warning, switch the variables over. – Pretty Cool Sep 19 '17 at 08:36
  • why didn't they just change the implementation of the original function with the same parameters order in later releases ?! – Amr Saber Jun 20 '18 at 00:15
  • @tynn how to "find this information in Android Studio", when I click 'more' on the hint, it just say the current is deprecated, that's it, no solution. – thanhbinh84 Nov 23 '18 at 08:33
  • @tynn the javadoc on android studio says nothing https://www.dropbox.com/s/ski1w4myqxfsbd5/Screenshot%202018-11-23%2015.53.49.png?dl=0 I am using java, or it is just available in Kotlin. I wonder because every time facing a deprecated method, I have to search on the doc from the internet. I would be great if I can found directly in AS. Thanks – thanhbinh84 Nov 23 '18 at 08:57
  • @thanhbinh84 it looks like you don't have the _JavaDoc_ available. It's not related to _Kotlin_ or _Java_. Maybe _Google_ doesn't provide the docs. Maybe you're using a different repository. But since you have a clear question which is unrelated to this one here, you should consider asking it separately. You'll find more input like this. – tynn Nov 23 '18 at 09:46
  • @tynn if possible, please capture your screenshot, otherwise that's fine. Thanks anyway. I will post question then. :) – thanhbinh84 Nov 23 '18 at 09:52