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 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 so im working on this php image upload system but for some reason
Okay, so this probably sounds terribly nefarious, but I need such capabilities for my
Note: Now that I've typed this out, I have to apologize for the super
Okay, here's the scenario. I have a utility that processes tons of records, and
Okay, I've seen but haven't programmed in C# before. You can assume I'm competent
Okay. I know this looks like the typical Why didn't he just Google it
My apologies, I've actually asked this question multiple times, but never quite understood the
Is there a distributed application framework (commercial is okay as well) that supports iPhone
Okay, I am still learning how to program and things are moving along quite
Okay, this is a little hard to explain, as the title might suggest. 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.