Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:43:23+00:00 2026-06-13T11:43:23+00:00

Previously i was using showDialog() which now is deprecated. I am already in a

  • 0

Previously i was using showDialog() which now is deprecated.

I am already in a Fragment which contains an EditText. How can i call this DatePickerDialog and set the EditText’s Text to the selected date?

Using DialogFragment seems a bit complicated.

Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:43:24+00:00Added an answer on June 13, 2026 at 11:43 am

    Its easy:

    DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {
    
        public void onDateSet(DatePicker view, int year,
                int monthOfYear, int dayOfMonth) {
            mYear = year;
            mMonth = monthOfYear;
            mDay = dayOfMonth;
            updateDisplay();
        }
    };
    
    DatePickerDialog d = new DatePickerDialog(getActivity(),
            R.style.MyThemee, mDateSetListener, mYear, mMonth, mDay);
    d.show();
    

    UpdateDisplay method:

    private void updateDisplay() {
    
        GregorianCalendar c = new GregorianCalendar(mYear, mMonth, mDay);
        SimpleDateFormat sdf = new SimpleDateFormat("dd MMMM yyyy");
    
        editDate.setText(sdf.format(c.getTime()));
    
        sdf = new SimpleDateFormat("yyyy-MM-dd");
    
        transDateString=sdf.format(c.getTime());
    }// updateDisplay
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was previously using How can a formcollection be enumerated in ASP.NET MVC? 's
Can I access the ASP.NET Cache object from Application_Start? I was previously using it
I was previously using initWithContentsOfURL to download a plist into an NSDictionary, but this
I'm writing a WiX installer for an application which was deployed previously using ClickOnce.
The person who was previously using my PC at work set up a private
which NFC forum defined tags are you using? We were using previously NFC forum
I am working on some code that previously was using a cfquery, and is
I'm looking to implement a REST client in PHP, and have previously been using
previously i was using picture box and its built in utilities to draw some
I have deployed a PHP application on my tomcat server(Tomcat 6.0).Previously I was using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.