Is there any way to create autoscroll to a listview ?, in Android Studio

0

I have a problem, make an example of a chat I found on the Internet, the example works very well only when trying to send messages and did not become autoscroll every time I sent messages, I had to scroll myself to be able to see the new message received ... And based on this, I was doubtful if there is any method that can be done autoscroll to a listview? so that every one that receives a message appears on screen and I do not have to upload the listview to see the message

here the link of the tutorial that I followed to do the chat ...

link

    
asked by Jorge1023 04.02.2017 в 09:39
source

1 answer

1

Friends and fix my problem was simple I just had to put these three lines on the onCreate

    ListView listOfMessage = (ListView)findViewById(R.id.list_of_message);
    listOfMessage.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
    listOfMessage.setStackFromBottom(true);

Where listOfMessage takes the value of my ListView named list_of_message ... and it was all ready with that there is autoscroll every time I receive a message ...

    
answered by 04.02.2017 в 10:15