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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:49:22+00:00 2026-05-27T18:49:22+00:00

I am facing one issue, i am using time picker to display hours and

  • 0

I am facing one issue, i am using time picker to display hours and minutes, User can change the Hours and minutes value upon taping on the hours and minutes field so it will open android keypad to enter new value of hours and minutes but what I observed that sometimes hours value updated properly and sometimes minutes value but at a time only one value is coming properly and other value is 0. I am using timepicker.getCurrenrHour() and getCurrentMinute() methods to get the updated value , but both value are not coming properly.

Please help me to resolve this issue.

Regards,
Amit

  • 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-05-27T18:49:23+00:00Added an answer on May 27, 2026 at 6:49 pm

    Use this code :

    package org.stellent.Sample;
    
    import java.util.Calendar;
    
    import android.app.Activity;
    import android.app.DatePickerDialog;
    import android.app.Dialog;
    import android.app.TimePickerDialog;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.DatePicker;
    import android.widget.TimePicker;
    
    public class DateandTime extends Activity implements OnClickListener{
    private static final int TIME_DIALOG = 1;
    Button time;
    
    public void onCreate(Bundle state){
    super.onCreate(state);
    setContentView(R.layout.timeanddate);
    
    time=(Button)findViewById(R.id.time);
    
    time.setOnClickListener(this);
    
    }
    
    @Override
    public void onClick(View v) {
    if(v.equals(time)){
    showDialog(TIME_DIALOG);        
    }
    }
    
    public Dialog onCreateDialog(int id){
    Calendar cal=Calendar.getInstance();        
    switch(id){
    case TIME_DIALOG:
    return new TimePickerDialog(this,timepicker,cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE), false);
    }
    return null;
    }
    
    
    TimePickerDialog.OnTimeSetListener timepicker=new TimePickerDialog.OnTimeSetListener(){
    @Override
    public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
    Log.e("time :",String.valueOf(hourOfDay)+" : "+String.valueOf(minute));
    }
    };
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of my colleagues is facing an issue with creating a test plan using
I am new to MVC and facing one issue. I have a xml file
I’m facing an issue with NHibernate performance and can you please suggest me some
i am using toplink as ORM tool, i am facing one peculiar problem. I
I'm facing UITableViewCell setup issue when user scrolls down and up the table. The
I am facing issue in binding the gridview when one of the tag in
I am using NetTopologySuite for some simplificaiton of lines. The issue I am facing
I am facing one issue because of URL encoding in window.open function when used
I am facing a very strange issue regarding the cookie value of the browser.
I'm facing the issue when arranging one array in PHP. Please help me out.

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.