title: Focus/Scroll recyclerView to last Item
body: <p>My app has main, chat style, activity made of a RecycleView which is filled by a list. the recycle should scroll/focus to the last item of the list after the user insert a new item (text input, photo/video capture) but recycler keeps focus on the first item inside the list even after using recyclerView.scrollToPosition(CustomList.size()-1).</p>
  
  <p>complete code available at: <a href="https://github.com/MikeSys/ChatApp" rel="nofollow noreferrer">https://github.com/MikeSys/ChatApp</a></p>
  
  <hr>
  
  <h2>MainActivity</h2>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
  
      // Elementi Grafici-----------------------------------------
  
      RecyclerView recyclerView = findViewById(R.id.recyclerView);
      Button video = findViewById(R.id.video);
      Button camera = findViewById(R.id.camera);
      Button send = findViewById(R.id.send);
      videoView =findViewById(R.id.rec);
      final EditText editText = findViewById(R.id.editText);
  
      // Media Controller----------------------------------------
  
  
  
      // Layout Manager------------------------------------------------
  
      linearLayoutManager = new LinearLayoutManager(MainActivity.this);
      linearLayoutManager.setStackFromEnd(true);
      recyclerView.setLayoutManager(linearLayoutManager);
  
  
      // Adapter-----------------------------------------
  
      if(dati.size()&gt; 1){  
          adapter =  new myAdapter(dati, this);
          adapter.notifyDataSetChanged();
          adapter.notifyItemInserted(dati.size()-1);
          recyclerView.setAdapter(adapter);
          //Setted recyclerView to scroll to the last item of the List
          recyclerView.scrollToPosition(dati.size()-1);
      }
  
  
      else{
          adapter =  new myAdapter(dati,this);
          recyclerView.setAdapter(adapter);
      }
  </code></pre>
  
  <hr>
  
  <h2>MainActivity Layout</h2>
  
  <pre><code>&lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  tools:context=".MainActivity"&gt;
  
  
  &lt;android.support.v7.widget.RecyclerView
      android:background="@drawable/sfondo"
      android:foregroundGravity="center"
      android:id="@+id/recyclerView"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      app:layout_constraintBottom_toTopOf="@+id/editText"
      app:layout_constraintTop_toTopOf="parent"
      tools:layout_editor_absoluteX="0dp"
      app:stackFromEnd="true"/&gt;
  
  
  &lt;EditText
      android:id="@+id/editText"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_marginEnd="160dp"
      android:background="#0003A9F4"
      android:hint="Scrivi"
      android:padding="20dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintHorizontal_weight="3"
      app:layout_constraintStart_toStartOf="parent" /&gt;
  
  
  &lt;Button
      android:id="@+id/send"
      android:layout_width="55dp"
      android:layout_height="64dp"
      android:background="@drawable/send"
      app:layout_constraintBottom_toBottomOf="@+id/editText"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintHorizontal_bias="1.0"
      app:layout_constraintStart_toEndOf="@+id/editText"
      app:layout_constraintTop_toTopOf="@+id/editText"
      app:layout_constraintVertical_bias="0.0"/&gt;
  
  &lt;Button
      android:id="@+id/camera"
      android:layout_width="50dp"
      android:layout_height="50dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"
      android:layout_marginBottom="16dp"
      android:background="@drawable/camera"
      app:layout_constraintBottom_toBottomOf="@+id/editText"
      app:layout_constraintEnd_toStartOf="@+id/send"
      app:layout_constraintHorizontal_bias="1.0"
      app:layout_constraintStart_toStartOf="@+id/editText"
      app:layout_constraintTop_toTopOf="@+id/editText"
      app:layout_constraintVertical_bias="0.0" /&gt;
  
  &lt;Button
      android:id="@+id/video"
      android:layout_width="50dp"
      android:layout_height="50dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"
      android:background="@drawable/video"
      app:layout_constraintEnd_toStartOf="@+id/camera"
      app:layout_constraintHorizontal_bias="1.0"
      app:layout_constraintStart_toStartOf="@+id/editText"
      app:layout_constraintTop_toBottomOf="@+id/recyclerView" /&gt;
  </code></pre>
  
  <p></p>
  
  <hr>
  
  <h2>Screenshots</h2>
  
  <p><a href="https://i.stack.imgur.com/Hz5Po.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hz5Po.jpg" alt="enter image description here"></a></p>