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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:17:09+00:00 2026-05-27T15:17:09+00:00

I have a textview in an activity. I am changing its visibility. if(CheckBookmark(Constants.versusHeading.get(curVCount))) {

  • 0

I have a textview in an activity. I am changing its visibility.

if(CheckBookmark(Constants.versusHeading.get(curVCount))) {
    bookmark.setVisibility(View.VISIBLE);
    bookmark.setText("Bookmarked");
}
else {
    bookmark.setVisibility(View.GONE);
}

but UI is not updated. I have tried bookmark.invalidate() and bookmark.postinvalidate() but didn’t work. If I change textview visibility how do I refresh UI? Activity is still alive and running.

Okay I think I need to add more details. My bad should have mentioned in the first place….Initially when activity is displayed bookmark is visible but have no text.

Then user creates a bookmark. Checkbookmark returns true if bookmark is successfully created. In that case I add bookmarked as text. I am setting it to visible as it wasn’t working. If I quit activity and come back then bookmark text is displayed.

  • 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-27T15:17:10+00:00Added an answer on May 27, 2026 at 3:17 pm

    In general it should work the way you have it. The UI will update.

    You need to make sure your if else is returning correctly.

    Try setting the textview to VISIBILE intially to see if it appears and then try to toggle the TextView’s visibility

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

Sidebar

Related Questions

Let's say I have an Activity which displays a View containing a TextView .
I have a half screen custom view and a TextView in my activity. <com.sted.test.mainView
Alright, so i have an Activity. In the activity there is a textview and
I have a clickable TextView with a drawable as its background. I'm looking for
I have following textview in my Activity. I want to change the background color
I have an activity where I grab a textview normallythen I have a separate
I have a TextView that i inflate in my activity. When i set text
I have a problem where I have several TextView objects in my Activity. More
I have this code: import android.app.Activity; import android.os.Bundle; import android.os.CountDownTimer; import android.widget.TextView; public class
I have service, widget and activity....widget and activity both have one textview which should

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.