Programmatically add transitionName to Toolbar Title (Android)
<p>Is it possible to programmatically set the xml property <code>transitionName</code> to a <code>Toolbar</code> title and then use it for an animation using <code>ActivityOptionsCompat</code>?</p>

<p>This is how I declare my <code>Toolbar</code>:</p>

<pre><code>        Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
        myToolbar.setTitle("title");
</code></pre>

<p>And this is my xml declaration:</p>

<pre><code>&lt;android.support.v7.widget.Toolbar
        android:id="@+id/my_toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/primary_color"
        android:elevation="4dp"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
        android:popupTheme="@style/ThemeOverlay.AppCompat.Light"/&gt;
</code></pre>

<p>In order to add the animation I have to use the following code:</p>

<pre><code>ActivityOptionsCompat options =
ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
    albumCoverImageView,   // The view which starts the transition (Should be myToolbar title)
    transitionName    // The transitionName of the view
    );
ActivityCompat.startActivity(activity, intent, options.toBundle());
</code></pre>

<p>How can I pass the <code>Toolbar</code> (<code>TextView</code> ?) title to the <code>makeSceneTransitionAnimation</code> function?</p>