Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: auto scrolling down the EditTextView for chat apps
    primarykey
    data
    text
    <p>Thank you for looking, I am creating a chat application. It works for the most part. The only thing I have a problem with is the scrolling. I use <strong>EditText</strong> to publish the new message from the server.</p> <p>by method</p> <pre><code>msg = msg + "\n" + newMsg EditText.setText(msg) </code></pre> <p>I need to make the new text that is under the old text visible as soon as it comes.</p> <p>So I think best way is to <strong>auto scroll down</strong> to the bottom as soon as the view is updated.</p> <p>Is there an easy way to do that? like in <strong>layout</strong> maybe?</p> <p>Thanks again!</p> <p>code for layout</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;Button android:id="@+id/sendButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:text="send" /&gt; &lt;EditText android:id="@+id/msgBox" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true" android:layout_toLeftOf="@+id/sendButton" android:gravity="left" android:longClickable="false" /&gt; &lt;EditText android:id="@+id/chatBox" android:layout_width="fill_parent" android:layout_height="fill_parent" android:editable="false" android:layout_above="@+id/msgBox" android:scrollbars="vertical" android:gravity="left|top" android:isScrollContainer="true" android:cursorVisible="false" android:longClickable="false" android:clickable="false" android:autoLink="all" /&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload