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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:38:25+00:00 2026-06-06T11:38:25+00:00

The expanded_status_bar layout in AOSP 4.0.4 has a TextView that looks like this in

  • 0

The expanded_status_bar layout in AOSP 4.0.4 has a TextView that looks like this in the XML

<com.android.systemui.statusbar.policy.DateView
    android:id="@+id/date"
    android:textAppearance="@style/TextAppearance.StatusBar.Date"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="4dp"
    android:singleLine="true"
    android:gravity="center"
    android:visibility="visible" />

It is generated by “frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java”

It is inflated by “frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java” like so:

ExpandedView expanded = (ExpandedView) View.inflate(context, R.layout.status_bar_expanded, null);
// stuff here
mDateView = (DateView) expanded.findViewById(R.id.date);

I want to set its visibility via another class and I’ve tried a few things that I have read on here, all with no luck. The last thing I tried was, in my class (which is also part of systemui), to add the following:

TextView mDateView = (TextView) findViewById(R.id.date);
mDateView.setVisibility(View.GONE);

However, it turns out mDateView is null in my class. Is there something I am missing? I’ve been looking all over for hours and trying things here and there but nothing works. I have intermediate-level Java skills and I am still trying to wrap my arms around the OOP thing having coming from 20 years of procedural languages. Thanks in advance.

I changed mDateView’s definition to look like this:

private DateView mDateView;
DateView mDateView = (DateView) findViewById(R.id.date);

But I am still getting mDateView as being null 🙁

  • 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-06T11:38:27+00:00Added an answer on June 6, 2026 at 11:38 am

    Initially i misunderstood your question, you can add methods in one class and access it via another.

    public static void hideDateView() {
            mDateView.setVisibility(View.GONE);
        }
    

    You can add the following method in PhoneStatusBar.java and Call it later.

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

Sidebar

Related Questions

This JSON response from the Twitter Stream API looks like so: entities: { media:
The widget looks like this: $this->widgetSchema['tara'] = new sfWidgetFormChoice(array( 'choices' => Doctrine_Core::getTable('Users')->getCountry(), 'expanded' =>
I've created a custom notification that is shown in the statusbar. I need to
I know that Android provides a mechanism to allow developers to save and restore
I have a really trivial perl script that I would like to distribute to
The Android NDK has just been significantly expanded to include support for writing android
a[1][2] is expanded by compiler like this: *( *(a+1) +2 ) . So if
I would like to create a notification that clears automatically when the user presses
A pretty normal case: We have a 'portlet' composite component that has two states:
I have an app that puts the date in the status bar, but in

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.