How to go a specific textview?











up vote
-1
down vote

favorite












So this is my code in java:



 Button bt1 = (Button) findViewById(R.id.button1);
bt1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
TextView txt1 = (TextView) findViewById(R.id.here);


I only have one xml file and it has a scrollable layout with 1 button and a lot of textview. I'm wondering how I can go to a specific textview using a button. I only want my button to go to the last textview(findViewById(R.id.here)) in my xml file once it's clicked. How can I do that? Can you please help me? Thank you very much.



This is my xml file:



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.search.MainActivity" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="389dp"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

<TextView
android:id="@+id/here1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="Right here" />

</LinearLayout>

</ScrollView>




I want to go to the last textview once the button is clicked. Thankyou










share|improve this question
























  • do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
    – Vevmesteren
    Nov 10 at 1:59










  • For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:09










  • can you share your code and your xml that contain the linearlayout ( button and textview)
    – Hassan Badawi
    Nov 10 at 2:41










  • I edited my question already. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:55















up vote
-1
down vote

favorite












So this is my code in java:



 Button bt1 = (Button) findViewById(R.id.button1);
bt1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
TextView txt1 = (TextView) findViewById(R.id.here);


I only have one xml file and it has a scrollable layout with 1 button and a lot of textview. I'm wondering how I can go to a specific textview using a button. I only want my button to go to the last textview(findViewById(R.id.here)) in my xml file once it's clicked. How can I do that? Can you please help me? Thank you very much.



This is my xml file:



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.search.MainActivity" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="389dp"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

<TextView
android:id="@+id/here1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="Right here" />

</LinearLayout>

</ScrollView>




I want to go to the last textview once the button is clicked. Thankyou










share|improve this question
























  • do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
    – Vevmesteren
    Nov 10 at 1:59










  • For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:09










  • can you share your code and your xml that contain the linearlayout ( button and textview)
    – Hassan Badawi
    Nov 10 at 2:41










  • I edited my question already. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:55













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











So this is my code in java:



 Button bt1 = (Button) findViewById(R.id.button1);
bt1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
TextView txt1 = (TextView) findViewById(R.id.here);


I only have one xml file and it has a scrollable layout with 1 button and a lot of textview. I'm wondering how I can go to a specific textview using a button. I only want my button to go to the last textview(findViewById(R.id.here)) in my xml file once it's clicked. How can I do that? Can you please help me? Thank you very much.



This is my xml file:



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.search.MainActivity" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="389dp"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

<TextView
android:id="@+id/here1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="Right here" />

</LinearLayout>

</ScrollView>




I want to go to the last textview once the button is clicked. Thankyou










share|improve this question















So this is my code in java:



 Button bt1 = (Button) findViewById(R.id.button1);
bt1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
TextView txt1 = (TextView) findViewById(R.id.here);


I only have one xml file and it has a scrollable layout with 1 button and a lot of textview. I'm wondering how I can go to a specific textview using a button. I only want my button to go to the last textview(findViewById(R.id.here)) in my xml file once it's clicked. How can I do that? Can you please help me? Thank you very much.



This is my xml file:



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.search.MainActivity" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="389dp"
android:orientation="vertical" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />

<TextView
android:id="@+id/here1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="HERE!" />

<TextView
android:id="@+id/here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="400dp"
android:text="Right here" />

</LinearLayout>

</ScrollView>




I want to go to the last textview once the button is clicked. Thankyou







java android xml android-studio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 4:02









Andrew Thompson

152k27161334




152k27161334










asked Nov 10 at 1:29









Gerald Manibale

347




347












  • do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
    – Vevmesteren
    Nov 10 at 1:59










  • For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:09










  • can you share your code and your xml that contain the linearlayout ( button and textview)
    – Hassan Badawi
    Nov 10 at 2:41










  • I edited my question already. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:55


















  • do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
    – Vevmesteren
    Nov 10 at 1:59










  • For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:09










  • can you share your code and your xml that contain the linearlayout ( button and textview)
    – Hassan Badawi
    Nov 10 at 2:41










  • I edited my question already. Thankyouu
    – Gerald Manibale
    Nov 10 at 2:55
















do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
– Vevmesteren
Nov 10 at 1:59




do you think you could clarify "want my button to go to the last textview" what exactly do you want to happen when the button is pressed?
– Vevmesteren
Nov 10 at 1:59












For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
– Gerald Manibale
Nov 10 at 2:09




For example, I have a scrollview inside that i have linearlayout which have a button and a lot of text view. I have 10 different textview with different text inside of it. Once my button is clicked, I want it to go to the 10th textview. Thankyouu
– Gerald Manibale
Nov 10 at 2:09












can you share your code and your xml that contain the linearlayout ( button and textview)
– Hassan Badawi
Nov 10 at 2:41




can you share your code and your xml that contain the linearlayout ( button and textview)
– Hassan Badawi
Nov 10 at 2:41












I edited my question already. Thankyouu
– Gerald Manibale
Nov 10 at 2:55




I edited my question already. Thankyouu
– Gerald Manibale
Nov 10 at 2:55












2 Answers
2






active

oldest

votes

















up vote
2
down vote













you can scroll to any widget in scroll view by this code:(kotlin syntax, if you want change to Java):



fun scrollToView(scrollViewParent: ScrollView, view: View) {
val childOffset = Point()
getDeepChildOffset(scrollViewParent, view.parent, view, childOffset)
scrollViewParent.smoothScrollTo(0, childOffset.y)
}

private fun getDeepChildOffset(mainParent: ViewGroup, parent: ViewParent, child: View, accumulatedOffset: Point) {
val parentGroup = parent as ViewGroup
accumulatedOffset.x += child.left
accumulatedOffset.y += child.top
if (parentGroup == mainParent) {
return
}
getDeepChildOffset(mainParent, parentGroup.parent, parentGroup, accumulatedOffset)
}


then you just call scrollToView by each view that you want to scroll to it






share|improve this answer




























    up vote
    1
    down vote













    im still not understand you very well check this answer about what i understand from you



    Button bt1 = (Button) findViewById(R.id.button1);
    TextView txt1 = (TextView) findViewById(R.id.here);
    ScrollView scrollv = (ScrollView)findViewById(R.id.scrollView1);
    bt1.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View view) {
    Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
    scrollv.scrollTo(0, scrollv.getBottom());


    now if that not your answer try to explain me more






    share|improve this answer























    • I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
      – Gerald Manibale
      Nov 10 at 3:21










    • It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
      – Gerald Manibale
      Nov 10 at 3:25










    • then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
      – Hassan Badawi
      Nov 10 at 3:25










    • do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
      – Hassan Badawi
      Nov 10 at 3:26






    • 1




      Thankyouu for your time sir. Its working now
      – Gerald Manibale
      Nov 10 at 4:07











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235259%2fhow-to-go-a-specific-textview%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    you can scroll to any widget in scroll view by this code:(kotlin syntax, if you want change to Java):



    fun scrollToView(scrollViewParent: ScrollView, view: View) {
    val childOffset = Point()
    getDeepChildOffset(scrollViewParent, view.parent, view, childOffset)
    scrollViewParent.smoothScrollTo(0, childOffset.y)
    }

    private fun getDeepChildOffset(mainParent: ViewGroup, parent: ViewParent, child: View, accumulatedOffset: Point) {
    val parentGroup = parent as ViewGroup
    accumulatedOffset.x += child.left
    accumulatedOffset.y += child.top
    if (parentGroup == mainParent) {
    return
    }
    getDeepChildOffset(mainParent, parentGroup.parent, parentGroup, accumulatedOffset)
    }


    then you just call scrollToView by each view that you want to scroll to it






    share|improve this answer

























      up vote
      2
      down vote













      you can scroll to any widget in scroll view by this code:(kotlin syntax, if you want change to Java):



      fun scrollToView(scrollViewParent: ScrollView, view: View) {
      val childOffset = Point()
      getDeepChildOffset(scrollViewParent, view.parent, view, childOffset)
      scrollViewParent.smoothScrollTo(0, childOffset.y)
      }

      private fun getDeepChildOffset(mainParent: ViewGroup, parent: ViewParent, child: View, accumulatedOffset: Point) {
      val parentGroup = parent as ViewGroup
      accumulatedOffset.x += child.left
      accumulatedOffset.y += child.top
      if (parentGroup == mainParent) {
      return
      }
      getDeepChildOffset(mainParent, parentGroup.parent, parentGroup, accumulatedOffset)
      }


      then you just call scrollToView by each view that you want to scroll to it






      share|improve this answer























        up vote
        2
        down vote










        up vote
        2
        down vote









        you can scroll to any widget in scroll view by this code:(kotlin syntax, if you want change to Java):



        fun scrollToView(scrollViewParent: ScrollView, view: View) {
        val childOffset = Point()
        getDeepChildOffset(scrollViewParent, view.parent, view, childOffset)
        scrollViewParent.smoothScrollTo(0, childOffset.y)
        }

        private fun getDeepChildOffset(mainParent: ViewGroup, parent: ViewParent, child: View, accumulatedOffset: Point) {
        val parentGroup = parent as ViewGroup
        accumulatedOffset.x += child.left
        accumulatedOffset.y += child.top
        if (parentGroup == mainParent) {
        return
        }
        getDeepChildOffset(mainParent, parentGroup.parent, parentGroup, accumulatedOffset)
        }


        then you just call scrollToView by each view that you want to scroll to it






        share|improve this answer












        you can scroll to any widget in scroll view by this code:(kotlin syntax, if you want change to Java):



        fun scrollToView(scrollViewParent: ScrollView, view: View) {
        val childOffset = Point()
        getDeepChildOffset(scrollViewParent, view.parent, view, childOffset)
        scrollViewParent.smoothScrollTo(0, childOffset.y)
        }

        private fun getDeepChildOffset(mainParent: ViewGroup, parent: ViewParent, child: View, accumulatedOffset: Point) {
        val parentGroup = parent as ViewGroup
        accumulatedOffset.x += child.left
        accumulatedOffset.y += child.top
        if (parentGroup == mainParent) {
        return
        }
        getDeepChildOffset(mainParent, parentGroup.parent, parentGroup, accumulatedOffset)
        }


        then you just call scrollToView by each view that you want to scroll to it







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 4:12









        saeedata

        32116




        32116
























            up vote
            1
            down vote













            im still not understand you very well check this answer about what i understand from you



            Button bt1 = (Button) findViewById(R.id.button1);
            TextView txt1 = (TextView) findViewById(R.id.here);
            ScrollView scrollv = (ScrollView)findViewById(R.id.scrollView1);
            bt1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
            Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            scrollv.scrollTo(0, scrollv.getBottom());


            now if that not your answer try to explain me more






            share|improve this answer























            • I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
              – Gerald Manibale
              Nov 10 at 3:21










            • It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
              – Gerald Manibale
              Nov 10 at 3:25










            • then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
              – Hassan Badawi
              Nov 10 at 3:25










            • do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
              – Hassan Badawi
              Nov 10 at 3:26






            • 1




              Thankyouu for your time sir. Its working now
              – Gerald Manibale
              Nov 10 at 4:07















            up vote
            1
            down vote













            im still not understand you very well check this answer about what i understand from you



            Button bt1 = (Button) findViewById(R.id.button1);
            TextView txt1 = (TextView) findViewById(R.id.here);
            ScrollView scrollv = (ScrollView)findViewById(R.id.scrollView1);
            bt1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
            Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            scrollv.scrollTo(0, scrollv.getBottom());


            now if that not your answer try to explain me more






            share|improve this answer























            • I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
              – Gerald Manibale
              Nov 10 at 3:21










            • It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
              – Gerald Manibale
              Nov 10 at 3:25










            • then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
              – Hassan Badawi
              Nov 10 at 3:25










            • do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
              – Hassan Badawi
              Nov 10 at 3:26






            • 1




              Thankyouu for your time sir. Its working now
              – Gerald Manibale
              Nov 10 at 4:07













            up vote
            1
            down vote










            up vote
            1
            down vote









            im still not understand you very well check this answer about what i understand from you



            Button bt1 = (Button) findViewById(R.id.button1);
            TextView txt1 = (TextView) findViewById(R.id.here);
            ScrollView scrollv = (ScrollView)findViewById(R.id.scrollView1);
            bt1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
            Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            scrollv.scrollTo(0, scrollv.getBottom());


            now if that not your answer try to explain me more






            share|improve this answer














            im still not understand you very well check this answer about what i understand from you



            Button bt1 = (Button) findViewById(R.id.button1);
            TextView txt1 = (TextView) findViewById(R.id.here);
            ScrollView scrollv = (ScrollView)findViewById(R.id.scrollView1);
            bt1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
            Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            scrollv.scrollTo(0, scrollv.getBottom());


            now if that not your answer try to explain me more







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 10 at 3:47

























            answered Nov 10 at 3:06









            Hassan Badawi

            817




            817












            • I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
              – Gerald Manibale
              Nov 10 at 3:21










            • It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
              – Gerald Manibale
              Nov 10 at 3:25










            • then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
              – Hassan Badawi
              Nov 10 at 3:25










            • do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
              – Hassan Badawi
              Nov 10 at 3:26






            • 1




              Thankyouu for your time sir. Its working now
              – Gerald Manibale
              Nov 10 at 4:07


















            • I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
              – Gerald Manibale
              Nov 10 at 3:21










            • It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
              – Gerald Manibale
              Nov 10 at 3:25










            • then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
              – Hassan Badawi
              Nov 10 at 3:25










            • do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
              – Hassan Badawi
              Nov 10 at 3:26






            • 1




              Thankyouu for your time sir. Its working now
              – Gerald Manibale
              Nov 10 at 4:07
















            I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
            – Gerald Manibale
            Nov 10 at 3:21




            I'm sorry. I tried your code and it has an error in the getActivity part. Btw thankyou
            – Gerald Manibale
            Nov 10 at 3:21












            It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
            – Gerald Manibale
            Nov 10 at 3:25




            It's not working. I just want my app to automatically scroll to go to a specific textview once the button is clicked.
            – Gerald Manibale
            Nov 10 at 3:25












            then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            – Hassan Badawi
            Nov 10 at 3:25




            then try this ,, Toast.makeText(getApplicationContext(),txt1.getText().toString(),Toast.LENGTH_LONG).show();
            – Hassan Badawi
            Nov 10 at 3:25












            do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
            – Hassan Badawi
            Nov 10 at 3:26




            do u mean -- u need to make the scroll go to the last TextView not to control the textview itself ?!
            – Hassan Badawi
            Nov 10 at 3:26




            1




            1




            Thankyouu for your time sir. Its working now
            – Gerald Manibale
            Nov 10 at 4:07




            Thankyouu for your time sir. Its working now
            – Gerald Manibale
            Nov 10 at 4:07


















             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235259%2fhow-to-go-a-specific-textview%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to pass form data using jquery Ajax to insert data in database?

            National Museum of Racing and Hall of Fame

            Guess what letter conforming each word