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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:29:43+00:00 2026-06-08T10:29:43+00:00

I have a class (foo) extending ListActivity which instantiates a class (fooAdap) extending ArrayAdapter.

  • 0

I have a class (foo) extending ListActivity which instantiates a class (fooAdap) extending ArrayAdapter. In fooAdap, there is the getview() method where I populate my ListView.

From the foo class, I can call getListView().setDividerHeight(0) and make the divider disappear. Is there a way to access that method from getView() in fooAdap?

foo.java

public class foo extends ListActivity
{
   ...
   protected void onCreate (Bundle savedInstanceState)
   {
      super.onCreate (savedInstanceState);
      ...
      ListView lv = getListView ();
      lv.setDividerHeight (0);
      fooAdap foo = new fooAdap (this,android.R.layout.simple_list_item_single_choice, mRowData);
      ...
   }

fooAdap.java

public class fooAdap extends ArrayAdapter
{
   ...

   public View getView (int position, View convertView, ViewGroup parent)
   {
      ...

      switch (position)
      {
         case 1: // show divider for these rows in listview
         case 2:
         break;

         case 3: // hide divider for this row in listview
         break;
      }
      ...
   }
}
  • 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-08T10:29:45+00:00Added an answer on June 8, 2026 at 10:29 am

    I ended up making my own divider and setting the ListView dividerHeight() to 0 in the XML layout.

    I have a separate layout for the ListView rows and added another LinearLayout and TextView there. I then copied the file divider_horizontal_dark.9.png from the android sdk directory into my res/ directory and set the background of the new TextView to it as well as setting MaxHeight to 1dp for the textview.

    Now I can just toggle the LinearLayout to View.VISIBLE or View.GONE within getView() method. Long way around, but seems to get me what I want.

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

Sidebar

Related Questions

I have base class Foo with method spam and class Bar which overrides spam
I have class Foo which defines property Id . Class Bar inherits from Foo
Suppose I have class Foo(db.Model): bar = db.ReferenceProperty(Bar) foo = Foo.all().get() Is there a
I have class Foo { .... } Is there a way for Foo to
Say I have class Foo and I have a FooRepository class with a method
Say, I have a class Foo, extending class Bar. And I want to slightly
I have a base class Foo that has an Update() function, which I want
I have a class Foo, which has a (simple) destructor. Some other class contains
I have a class Foo which lives in Src/Projects/SomeProject/Foo.py I have a class FooTest(unittest.TestCase)
I have: class Foo; class Bar { Foo foo; Bar(): foo(foo) {}; } Bar

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.