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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:54:54+00:00 2026-05-26T04:54:54+00:00

I have three different activities sharing exactly the same layout (a ListView and a

  • 0

I have three different activities sharing exactly the same layout (a ListView and a TextView). The ListView uses this layout for its SimpleCursorAdapter:

  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:paddingBottom="2dp"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <TextView
      android:id="@+id/locationName"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="left"
      android:text="Länsnamn"
      android:textAppearance="?android:attr/textAppearanceMedium">
    </TextView>

    <LinearLayout
      android:id="@+id/num_stores_row"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">

      <TextView
        android:id="@+id/numStores_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="left"
        android:textSize="10dp"
        android:text="Antal butiker: ">
      </TextView>

      <TextView
        android:id="@+id/numStores"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:text="0">
      </TextView>
    </LinearLayout>

    <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">

      <TextView
        android:id="@+id/numItems_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="left"
        android:textSize="10dp"
        android:text="Antal artiklar: ">
      </TextView>

      <TextView
        android:id="@+id/numItems"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="10dp"
        android:text="0">
      </TextView>
    </LinearLayout>
  </LinearLayout>

The program goes from activity #1, user picks an item in the list, activity #2 starts, user picks list, activity #3 starts.

Now, all the list items turn up fine just like they should, but for activity #3 I’d like to remove the entire row with id num_stores_row, and I seem to have a hard time doing this. I cannot do this in the setViewBinder since the row is not targeted by the adapter, and I cannot do it outside since the ListView is not activated until the data arrives. I’ve tried findViewById(R.id.num_stores_row).setVisibility(View.GONE); here and there, but the simulator crashes every time.

How do I remove it?

  • 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-26T04:54:55+00:00Added an answer on May 26, 2026 at 4:54 am

    To add to what Mark said, override SimpleCursorAdapter’s getView and put your findViewById(R.id.num_stores_row).setVisibility(View.GONE); in there once you inflate the row’s view.

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

Sidebar

Related Questions

I have three tabbed activities and everyone is a listView with the same cursorAdapter.
I'm completely stumped on this one. I have three different lists that need to
I have three radio buttons with same name and different values.When I click the
I have three tabs with set up three different activities. When clicked on Tab3
I have different Activities where the catch{} block mostly should do the same, eg.
I have an a Java Android app that calls different activities. I thought this
I have three different configurations on my project, all three do not require all
I have three different development machines. Do I need three different iPhone Developer Program
I'm playing with a GWT/GAE project which will have three different pages, although it
I have a function that receives three different people objects and generates a new

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.