Problem with Datepickerdialog

Asked

Viewed 80 times

0

I bought a book to study Android, I’m following and trying to understand how the components work

When I click a button, I need you to open a modal with the date component.

I’m using SDK 19 with Android 4.2, and when in some method triggered by the click of the button, I call a showDialog, he returns me

The method showDialog(int) from the type Activity is deprecated

looks like it’s something related to the SDK version I’m using.

SS

1 answer

1

This information has nothing to do with the version of the SDK, but with the use of the method showDialog which considers itself outdated.

Starting with version 3.0 (SDK 11) a new way to use "Dialogs", who calls himself DialogFragment.

In practical terms swimming prevents it from continuing to use the method showDialog, however "Android team" recommends that DialogFragment.

As you are taking the first steps on Android recommend you ignore, for now, this message. When you have more experience then start exploring Fragments.

If you don’t want to follow my advice, see here how to use a DatePickerwith DialogFragment.

  • Thank you very much for the answer, but I can not ignore, because it does not run, me error when accessing Activity. =/

  • What’s the mistake that comes?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.