Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, thanks for the link to my blog. Second, let me see if I can't answer that for you. One of the reasons you're having trouble adding another button when you want to add a button is that in that example I left you with no way of retrieving the Title Bar View through the usual channels. Hence, let's fix it (and potentially let me write another blog post this coming weekend.)</p> <p>Starting with the xml file, add an id attribute:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:orientation="horizontal" android:id="@+id/title_complex"&gt; &lt;!-- Stuff --&gt; &lt;/LinearLayout&gt; </code></pre> <p>and here's code to show you how to get that button in there within your Activity (you'll have to add all the flair later):</p> <pre><code>LinearLayout layout = (LinearLayout) getWindow().findViewById(R.id.title_complex); layout.addView(new Button(this)); </code></pre> <p>and if you take a look, there's a non-descript button in the Title Bar (like I said, you'll have to add your own flair):</p> <p><img src="https://i.stack.imgur.com/tlXp2.jpg" alt="Title Bar with another button"></p> <p>Due note, however, that I can't guarantee that the button will remain or won't remain on subsequent Activities. I haven't investigated it yet but this should get you started. And if you have any more questions, feel free to ask them here (more eyeballs) or on my blog.</p>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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