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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:47:02+00:00 2026-06-08T22:47:02+00:00

I am having trouble with passing the date from the calendar to another activity.

  • 0

I am having trouble with passing the date from the calendar to another activity. It’s not the current date that I wanted to show, it’s the date that the user selects on the calendar that I have coded.
Below are my codes.

                            @Override
                public void onClick(View view)
                {
                    String date_month_year = (String)view.getTag();
                    selectedDayMonthYearButton.setText(new StringBuilder().append("Selected:").append(date_month_year));

                    Intent k = new Intent(Calendar_Event.this, Create_Events.class);
                 startActivity(k);

                    try
                    {
                        Date parsedDate = dateFormatter.parse(date_month_year);
                        Log.d(tag, "Parsed Date: " + parsedDate.toString());
                    }
                    catch(ParseException e)
                    {
                        e.printStackTrace();
                    }
                } 


                public int getCurrentDayOfMonth()
                    {
                        return currentDayOfMonth;
                    }

                private void setCurrentDayOfMonth(int currentDayOfMonth)
                    {
                        this.currentDayOfMonth = currentDayOfMonth;
                    }
                public void setCurrentWeekDay(int currentWeekDay)
                    {
                        this.currentWeekDay = currentWeekDay;
                    }
                public int getCurrentWeekDay()
                    {
                        return currentWeekDay;
                    }

        }//end GridCellAdapter

I trying to pass the date selected onClick to the next activity that this class is linked to.
Any help will be greatly appreciated, Thanks 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-08T22:47:04+00:00Added an answer on June 8, 2026 at 10:47 pm

    use Intent.putExtra(String date) for passing date from one activity to another Activity. Change your Button Click Code as in Calendar_Event.class:

    In Calendar_Event Activity :

    //Create new Intent Object, and specify class
    Intent intent = new Intent();
    
    intent.setClass(Calendar_Event.this,Create_Events.class);
    
    intent.putExtra("passdate","Date_var_here");  
    
    Calendar_Event.this.startActivity(intent);
    

    In Create_Events Activity :

    //obtain  Intent Object send  from SenderActivity
      Intent intent = this.getIntent();
    
      /* Obtain String from Intent  */
      if(intent !=null)
      {
         String strdata = intent.getExtras().getString("passdate");
        // DO SOMETHING HERE
      }
      else
      {
        // DO SOMETHING HERE
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble passing data from one activity to another. I can easily
I am having trouble passing data read from a text file to another class
CakePHP Newbie :) I am having trouble accessing another controller and passing that data
Having some trouble passing values from one class to another. I basically have a
I'm having trouble passing a float value from one object to another. It appears
I am having trouble passing the return value from TheMethod() to Main and displaying
I'm having some trouble passing an array from controller to a javascript in a
I'm having trouble passing a variable defined in one class instance to another class
I am having trouble passing data retrieved from a $.post() function to use in
I'm having trouble parsing an iso date from my json api/mongodb using rest kit.

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.