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 8805459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:52:21+00:00 2026-06-14T01:52:21+00:00

Iam fresher in android I selected Start date and end date from datepicker based

  • 0

Iam fresher in android I selected Start date and end date from datepicker based on that I need to insert dates between start date and end date into sqllite and then compare with current date and set reminder. Please let me know if you have solution

  • 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-14T01:52:23+00:00Added an answer on June 14, 2026 at 1:52 am

    To get date from Date picker use this

    DatePicker datePicker = (DatePicker) findViewById(R.id.datePicker1);
    int day = datePicker.getDayOfMonth();
    int month = datePicker.getMonth() + 1;
    int year = datePicker.getYear();
    

    Set the values to database

    public  void onDateSet(DatePicker view,int year,int monthOfYear,int dayOfMonth){
                dateTime.set(year,monthOfYear,dayOfMonth);
    
       int year = year;   // Here you can get day,month and year.
       int month = monthOfYear;
       int day = dayOfMonth;
    
    ContentValues values = new ContentValues()
    
    values.put("Day",dayOfMonth);
    values.put("Month",monthOfYear);
    values.put("Year",year);
    
    }
    

    You can get the database tutorials from here, here and here

    To get Current date

    String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());
    

    To set a reminder
    you can use the alaram manager to set the reminder the solution can be found here

    EDIT 2

    private class myReminderTask extends AsyncTask<Void, Void, Void>{
        ArrayList<String> list = new ArrayList<String>();
        @Override
        protected Void doInBackground(Void... params) {
            while(true)
            for(String s : list){
                Date d = //Make date from the string obtained from SQL
                d.toString().equals(DateFormat.getDateTimeInstance().format(new Date()));
    
                //Create an alaram or notification
            }
    
            return null;
        }
    
        @Override
        protected void onPreExecute() {
    
            Cursor c = null;
            c = db.rawQuery("select startDate,endDate from tablename" , null);
    
            if (cursor.getCount() != 0)
                {
                    if (cursor.moveToFirst())
                    {
                        do
                        {
                            list.add(cursor.getString(cursor.getColumnIndex("FirstDate")));
                            list.add(cursor.getString(cursor.getColumnIndex("LastDate")));
                        } while (cursor.moveToNext());
                    }
                    db.closeDatabase();
                }
                cursor.close();
    
            super.onPreExecute();
        }
    
    }
    

    Do the entire thing on AsyncTask (example here also )so that the main UI thread is not blocked, on pre execute code the database fetching and on do in background use the while loop so that it never ends

    This is what i can give rest you do the work… and that’s all, rest you have to search and work out your way don’t expect me to make and give an entire project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

iam developing one application.In that i need to get the music files from the
Iam developing one application.In that iam using the uilabels.And my problem is i need
Iam working in django-admin. In Django admin list page, I need to insert field
I am a fresher to Objective-C language. So i need some guidance from familiar
Iam developing one application.In that iam placing the radio buttons(uiimageview) on table view and
Iam trying to connect my android device with a bluetooth compatible device. I know
Iam developing one application.In that iam using one uiimageview.And take another image view and
Iam using applet for an application. In that when ever a conditin satifies,it has
Iam trying to resize the facebook profile picture to large. I understand that in
iam designin new app , and at some part i need two layouts on

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.