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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:56:25+00:00 2026-06-14T20:56:25+00:00

I am trying to show a gridview with text in it , basically it

  • 0

I am trying to show a gridview with text in it , basically it will be showing 7-8 values against every day of the year . so yes it gets pretty large pretty quickly.

And when i try to scroll down and i am in the middle , it runs out of memory.
here is how i am trying to do it

public View getView(int position, View convertView, ViewGroup parent) {
        dateView = new TextView(mContext);
        dateView.setText(dateArray.get(position));
        dateView.setSingleLine(true);
        // dateview.setLayoutParams(new GridView.LayoutParams(70, 70));
        Log.d("--in get view--", "");
                return dateView;
}

Is there any better way to do it , like may be releasing the view which are not showing in the screen at the moment?

  • 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-14T20:56:26+00:00Added an answer on June 14, 2026 at 8:56 pm

    You should reuse views. Now you create new instance of TextView every time getView called. But you’re given convertView. Android caches all views for you and reuse them, so instead of having 1000 views for every row it uses about 10-20 (how many visible on screen) views and reuse them. You should check first if convertView is not null then cast it to TextView and populate with your text otherwise you need to create TextView manually as you’re doing now and return it. Check this tutorial: http://www.vogella.com/articles/AndroidListView/article.html 5.2 ConvertView.

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

Sidebar

Related Questions

I'm trying to show a list of links (in index.html) to text files in
HI Im trying to show an image in a gridview, its held on the
I'm trying to extend the GridView class to always show the header and footer
I want to show a thumbnail image inside a gridview instead of the text.
I'm trying to get an ASP.NET 3.5 GridView to show a selected value as
I'm trying to get the text of a HyperLinkField in a GridView's OnRowDelete event
I'm trying to show a custom column in my gridview which displays a content
In a GridView, I'm trying to show either one column or an other using
I would like to show different values in a dropdownlist, while editing a gridview,
I'm trying to show Modal Popup when a user clicks LinkButton in GridView. I

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.