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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:19:52+00:00 2026-05-19T12:19:52+00:00

Okay well I apologize for how sloppy this code is, but I still cant

  • 0

Okay well I apologize for how sloppy this code is, but I still cant figure out how to post a code tag on here correctly. So I am making an Android application (Java) and i have a scrolling text field. If the user scrolls a long row down and stays at the end when they click the next row and if it is short, it will be scrolled down on that element too even though it may be a 1 line(and non scrollable) row. I was wondering if there is any way I can call something to right after txtLvlInfo.setText to reset the x-scroll value to 0 or something so it is always reset to the top of the content, long or short. Thanks for any help with this and please let me know if I need to clarify more.

TextView txtLvlInfo = (TextView) findViewById(R.id.txtLevelInfo);
txtLvlInfo.setMovementMethod(new ScrollingMovementMethod());  

switch (v.getId()){
    case R.id.row1:
    txtLvlInfo.setText("1: My text view is only two lines max and so I set it to scroll, if the user clicks row2 to load that text while having me scrolled down they have to click and pull to drag back down to the top of text view 2 row.");
    break;
    case R.id.row2:
    txtLvlInfo.setText("I only fill line 1 of the two.");
    break;
 }

_

<TextView    
    android:textColor="#052027"  
    android:text=""   
    android:id="@+id/txtLevelInfo"  
    android:scrollbars="vertical"  
    android:layout_alignParentLeft="true"  
    android:layout_width="fill_parent"   
    android:layout_height="fill_parent"  
    android:layout_toRightOf="@+id/minimizeBtn"  
    android:layout_marginRight="38dip">  
</TextView>
  • 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-19T12:19:53+00:00Added an answer on May 19, 2026 at 12:19 pm

    A tip for putting code in, just paste the code into the window, select it, and hit Ctrl(Cmd)+K. This will indent everything 4 spaces, and color and format your code.

    In regards to your question, where is this switch statement located?

    TextView does have a method inherited from View that you could use, called scrollTo(int, int), and just set to 0, 0, but I’m a little confused on what exactly you’re doing. What are these TextViews’ parent layouts? You could possibly just wrap the first TextView in a ScrollView, instead of doing setMovementMethod() (which I’m personally unfamiliar with).

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

Sidebar

Related Questions

Okay. Here's the code. XML Parsing Error: not well-formed <item_to_page_title><![CDATA[Breaking news, real-time scores and
Okay, for whatever reason I can't seem to figure this little problem out. I
Okay, so this is a bit confusing (well to me). I have a string
Okay, I feel a bit foolish for having to ask this but I guess
Okay, so hopefully I am asking this question correctly: I set up my user
Okay so this query should be easy but I'm having a bit of difficult.
Okay, right now I've got this statement and it's working well (note I've already
Okay well, here's the string $string = 123456789_some_0.png; i currently use preg_match to get
Okay, this might seem like a weird question, but bear with me. So I
Okay, so I realize I'm the 100th person asking a question about this, but

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.