Note that there are some explanatory texts on larger screens.

plurals
  1. POSony Smartwatch - update text in multiple TextViews simultaneously
    primarykey
    data
    text
    <p>I would like to update the text in the two TextViews on the Watch simultaneously.</p> <p><strong>main_layout.xml</strong></p> <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;TextView android:id="@+id/text1" android:layout_width="220px" android:layout_height="50px" /&gt; &lt;TextView android:id="@+id/text2" android:layout_width="220px" android:layout_height="50px" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>Now I'm doing it this way:</p> <pre class="lang-java prettyprint-override"><code>sendText(R.id.text1, "Hello world 1"); sendText(R.id.text2, "Hello world 2"); </code></pre> <p>The problem is, that I can see on the Watch, that the first text is set earlier, then the second one. And I would like to avoid that.</p> <p>Generally, Sony-SDK supports the data-updates in bundles, for example when showing a layout:</p> <pre class="lang-java prettyprint-override"><code>Bundle b1 = new Bundle(); b1.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.text1); b1.putString(Control.Intents.EXTRA_TEXT, "Hello world 1"); Bundle b2 = new Bundle(); b2.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.text2); b2.putString(Control.Intents.EXTRA_DATA_URI, "Hello world 2"); Bundle[] layoutData = new Bundle[] { b1, b2 }; showLayout(R.layout.main_layout, layoutData); </code></pre> <p>but in this case the layout is re-set, which is not so good in my case, because some other views on the screen may already have been changed.</p> <p>I hoped, it could be possible to achieve this through something like:</p> <pre class="lang-java prettyprint-override"><code>Bundle bundle = new Bundle(); bundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.text2); bundle.putString(Control.Intents.EXTRA_TEXT, "Hello world 2"); Intent intent = new Intent(Control.Intents.CONTROL_SEND_TEXT_INTENT); intent.putExtra(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.text1); intent.putExtra(Control.Intents.EXTRA_TEXT, "Hello world 1"); intent.putExtra(Control.Intents.EXTRA_LAYOUT_DATA, new Bundle[] { bundle }); sendToHostApp(intent); </code></pre> <p>but unfortunately the Watch seems to ignore the EXTRA_LAYOUT_DATA for the CONTROL_SEND_TEXT_INTENT intent.</p> <p>So my question is: is there any possibility to send text updates as a bundle without re-setting the layout?</p>
    singulars
    1. This table or related slice is empty.
    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. 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