[android-developers] Re: Textview Autoscroll?

2009-09-16 Thread Raphael

Are you not using Eclipse and ADT? If not, you should.

Eclipse should automatically switch to the debugger view when you
start an app in debug mode (right click your project and Debug As 
Android Application).
From there use the WindowsViewBreakpoint and using the ! icon set
a breakpoint on the java.lang.NullPointerException. Eclipse will then
show you the exact line of code where the exception occurs.

HTH
R/

On Tue, Sep 15, 2009 at 8:29 PM, Johnnyr jreyn...@gmail.com wrote:

 Nevermind! I figured out what was causing my crash. I forgot to
 declare the scrollview:

 scrollview=(ScrollView)findViewById(R.id.scrollview);

 it would be nice if I knew how to use the debugger =(

 On Sep 15, 5:34 pm, Johnnyr jreyn...@gmail.com wrote:
 Thank you for the reply. Unfortunatley, that code seems to throw an
 error.

 scrollview.scrollTo(0, outputBox.getHeight());

 scrollview is my scrollbox, outputBox is my textview.

 From the debugger, it looks like:

 Thread exiting due to uncaught exception
 java.lang.NullpointerException

 Any ideas?

 This is my xml for my layout:

 ?xml version=1.0 encoding=utf-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     
 ScrollView
 android:id=@+id/scrollview
 android:layout_width=wrap_content
 android:layout_height=200px

 TextView
 android:id=@+id/output
 android:layout_height=wrap_content
 android:layout_width=wrap_content
 android:textStyle=bold
 android:layout_marginLeft=10px
 android:text=This is a test Sentence.
 android:layout_marginBottom=0px
 android:layout_gravity=left
 /
 /ScrollView
 /RelativeLayout

 Thanks!

 On Sep 15, 4:55 pm, Raphael r...@android.com wrote:



  someTextView.setText(someText);
  scrollViewWrappingTheTextView.scrollTo(0, someTextView.getHeight());

  R/

  On Tue, Sep 15, 2009 at 4:35 PM, Johnnyr jreyn...@gmail.com wrote:

   Hi guys,

   I'm trying to get a text view, that is a child of a scrollview, to
   automatically scroll to the bottom when something new is appended to
   it. Right now I'm at a loss as to how to do this.

   Any ideas?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Textview Autoscroll?

2009-09-15 Thread Raphael

someTextView.setText(someText);
scrollViewWrappingTheTextView.scrollTo(0, someTextView.getHeight());

R/

On Tue, Sep 15, 2009 at 4:35 PM, Johnnyr jreyn...@gmail.com wrote:

 Hi guys,

 I'm trying to get a text view, that is a child of a scrollview, to
 automatically scroll to the bottom when something new is appended to
 it. Right now I'm at a loss as to how to do this.

 Any ideas?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Textview Autoscroll?

2009-09-15 Thread Johnnyr

Thank you for the reply. Unfortunatley, that code seems to throw an
error.

scrollview.scrollTo(0, outputBox.getHeight());

scrollview is my scrollbox, outputBox is my textview.

From the debugger, it looks like:

Thread exiting due to uncaught exception
java.lang.NullpointerException

Any ideas?

This is my xml for my layout:

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

ScrollView
android:id=@+id/scrollview
android:layout_width=wrap_content
android:layout_height=200px

TextView
android:id=@+id/output
android:layout_height=wrap_content
android:layout_width=wrap_content
android:textStyle=bold
android:layout_marginLeft=10px
android:text=This is a test Sentence.
android:layout_marginBottom=0px
android:layout_gravity=left
/
/ScrollView
/RelativeLayout


Thanks!

On Sep 15, 4:55 pm, Raphael r...@android.com wrote:
 someTextView.setText(someText);
 scrollViewWrappingTheTextView.scrollTo(0, someTextView.getHeight());

 R/



 On Tue, Sep 15, 2009 at 4:35 PM, Johnnyr jreyn...@gmail.com wrote:

  Hi guys,

  I'm trying to get a text view, that is a child of a scrollview, to
  automatically scroll to the bottom when something new is appended to
  it. Right now I'm at a loss as to how to do this.

  Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Textview Autoscroll?

2009-09-15 Thread Johnnyr

Nevermind! I figured out what was causing my crash. I forgot to
declare the scrollview:

scrollview=(ScrollView)findViewById(R.id.scrollview);

it would be nice if I knew how to use the debugger =(

On Sep 15, 5:34 pm, Johnnyr jreyn...@gmail.com wrote:
 Thank you for the reply. Unfortunatley, that code seems to throw an
 error.

 scrollview.scrollTo(0, outputBox.getHeight());

 scrollview is my scrollbox, outputBox is my textview.

 From the debugger, it looks like:

 Thread exiting due to uncaught exception
 java.lang.NullpointerException

 Any ideas?

 This is my xml for my layout:

 ?xml version=1.0 encoding=utf-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     
 ScrollView
 android:id=@+id/scrollview
 android:layout_width=wrap_content
 android:layout_height=200px

 TextView
 android:id=@+id/output
 android:layout_height=wrap_content
 android:layout_width=wrap_content
 android:textStyle=bold
 android:layout_marginLeft=10px
 android:text=This is a test Sentence.
 android:layout_marginBottom=0px
 android:layout_gravity=left
 /
 /ScrollView
 /RelativeLayout

 Thanks!

 On Sep 15, 4:55 pm, Raphael r...@android.com wrote:



  someTextView.setText(someText);
  scrollViewWrappingTheTextView.scrollTo(0, someTextView.getHeight());

  R/

  On Tue, Sep 15, 2009 at 4:35 PM, Johnnyr jreyn...@gmail.com wrote:

   Hi guys,

   I'm trying to get a text view, that is a child of a scrollview, to
   automatically scroll to the bottom when something new is appended to
   it. Right now I'm at a loss as to how to do this.

   Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---