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

  • Home
  • SEARCH
  • 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 9239909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:05:54+00:00 2026-06-18T08:05:54+00:00

As Android does not support showing the day for a date, I added a

  • 0

As Android does not support showing the day for a date, I added a TextView to my layout.

On the DatePicker I put an onDateChangedListener. When the date changes, I determine the day of the week and then set it via a Handler to be sure it is done on the UI thread:

// this is being called when the date changes on the DatePicker
public void onDateChanged(DatePicker view, final int year,
                final int monthOfYear, final int dayOfMonth) {
    String dayOfTheWeek = null;

    // some code here to set the 'dayOfTheWeek' string

    h.sendMessage(h.obtainMessage(0, dayOfTheWeek));
}

final Handler h = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        dayOfWeekTextView.setText((String)msg.obj);
    }
};

My issue: when I scroll through the days in the widget (Android 4.0 UI) it is not smooth! I check what the problem was, and it is not the way I determine what the String should be, it is really the setText() in the Handler. Commenting that part uit and everything is ok. Also setting a hardcoded text there (dayOfWeekTextView.setText("SOMETHING');) gives the same problem. It jitters the DatePicker.

Is setText() really that big of an action? Wunderlist shows the day of the week and there it runs smooth, but I just cannot find out how they do it.

I have only tested it on my HTC One X.
Anyone an idea?

Edit:

I found out why it is smooth in Wunderlist! I am using the same as them, a DialogFragment. You can set a title on the dialog and that is what Wunderlist uses instead of a TextView. So I’m going to use that (and looks better too 😉 )

So when doing ‘getDialog().setTitle(dayOfWeek)’ there is no problem. Still the question remains: how come the setText is that slow on the UI thread…?

  • 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-18T08:05:55+00:00Added an answer on June 18, 2026 at 8:05 am

    SOLUTION
    A very sexy and dirty solution would be to create 7 TextViews and toggle the visibility of one of them. Until the day that a week is extended to 8 days, this approach should work with much better performance.


    On a separate note, this might be due to the layout params of your textview. You might want to give it some extra space, or, in other words, a layout should not be incurred by setText. Am not sure if that is happening.

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

Sidebar

Related Questions

Does Android support virtual memory concept? I read it does use paging but not
I know that the android browser for 2.3 does not support SVG, but I'd
I have a tab-based Android app. Currently, it does not support landscape mode -
As Android does not currently support java7, I find myself wondering if they have
Android does not support ad-hoc WiFi networks. My question is, how can it distinguish
It seems that the android TTS classes found in the sdk does not support
is it the problem that android jre does not support html parser???!!!
I know android does not support TIFF format but I'm getting a Base64 image
I need to persist a object. Unfortunately sqlite in android does not support ORM.
It seems the java.net.NetworkInterface implementation of android does not have a byte[] getHardwareAddress() method

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.