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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:58:42+00:00 2026-06-15T23:58:42+00:00

Now textview shows the statement if i will scroll far away to the bottom.

  • 0

Now textview shows the statement if i will scroll far away to the bottom. Looks like promis textview become to large. Is there a way to fix it?

screenshot
everything under stars is part of promis textview. It is a single string with several newline characters
screenshot2 another screenshot

code that generate promises

prm = doc.getElementsByTagName("promise");
            for (int j = 0; j < prm.getLength(); j++) {
                prom += parser.getValue(e, KEY_PROMISES, j) + "\n";

            }
            prom.substring(0,prom.lastIndexOf('\n'));

layout

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget32"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <RelativeLayout
        android:id="@+id/top"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/face"
            android:layout_width="68dp"
            android:layout_height="68dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true" />

        <TextView
            android:id="@+id/name"
            android:layout_width="243dp"
            android:layout_height="35dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_toRightOf="@id/face"
            android:text="from" />

        <TextView
            android:id="@+id/office"
            android:layout_width="242dp"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/face"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/name"
            android:layout_toRightOf="@id/face"
            android:text="subject" />
    </RelativeLayout>

    <RatingBar
        android:id="@+id/ratingBar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/top"
        android:numStars="6"
        android:singleLine="false" />

    <TextView
        android:id="@+id/promises"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/ratingBar1"
        android:layout_marginTop="5dp"
        android:text="TextView" />

    <ScrollView
        android:id="@+id/scroll"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/promises"
        android:layout_marginRight="22dp"
        android:layout_marginTop="26dp" >

        <TextView
            android:id="@+id/statement"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TextView" />
    </ScrollView>

</RelativeLayout>

activity for my app

public class SingleMenuItemActivity  extends Activity {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.candidate);
        Log.d("here ?", "No ");
        int loader = R.drawable.loader;
        // getting intent data
        Intent in = getIntent();
        Log.d("here ?", "No ");
        // Get XML values from previous intent
        String name = in.getStringExtra("name");
        Log.d("Name ", name);
        Log.d("here ?", "No ");
        DatabaseHandler db = new DatabaseHandler(this);
        Log.d("here ?", "No ");
        Candidate p = db.getCandidate(name);
        Log.d("Did i take candidate? ", "yea ");
        db.close();
        Log.d("Statement", p.get_statment());
        // Displaying all values on the screen
        TextView lblName = (TextView) findViewById(R.id.name);
        TextView lblOffice = (TextView) findViewById(R.id.office);
        TextView lblPromise = (TextView) findViewById(R.id.promises);
        TextView lblStatement = (TextView) findViewById(R.id.statement);
        ImageView lblFace = (ImageView) findViewById(R.id.face);
        RatingBar lblRating = (RatingBar) findViewById(R.id.ratingBar1);
        ImageLoader imgLoader = new ImageLoader(this);
        lblName.setText(p.get_name());
        lblOffice.setText(p.get_office());
        lblPromise.setText(p.get_promises());
        lblStatement.setText(p.get_statment());
        lblRating.setRating(p.get_ranking());
        imgLoader.DisplayImage(p.get_photograph(), loader, lblFace);

    }
}

logcat says p.get_statment() has proper value in it

12-16 05:07:16.089: D/Statement(279): I strive for the highest standards of appearance and personal grooming.  If, like me, you think that the University's reputation is being dragged down by lecturers who have little or no regard for fashion and are content to wear ill-fitting or patched clothes then vote for me: the stylish choice.

reputation is to low to post image %)

  • 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-15T23:58:43+00:00Added an answer on June 15, 2026 at 11:58 pm

    Ok i found solution, besides i dont understand why textview expanded so much i know how to fix it now:)
    first of all we need to know number of lines, which string will produce

    private static int countLines(String str){
               String[] lines = str.split("\r\n|\r|\n");
               return  lines.length;
            }
    

    then simply limit textview in the size

    lblPromise.setMaxLines(countLines(p.get_promises()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any simple way how to draw obliquely strike through on TextView? Now
I have a problem now! I have custom ListView, there I have two TextView
Now I am doing an application.In my app I have to change textview value
I've a RelativeLayout which consists of an ImageView and TextView. Now, to this RelativeLayout
I have one class that shows me a list of Items. Right now I
I'm developing an android app which shows phone contact as ListView(used Cursoradapter).Now I Want
Is there something simple i might be missing? The kruis picture shows up on
I have an app that shows images from an tumblr account. At the bottom
In My textView there is a default value of First name I want to
There was some progress made to the earlier problem. Now there is 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.