Android Junit test fails with " Only the original thread that created a view hierarchy can touch its views."
<p>I am very new to Android and am writing some basic Android tests using Robotium and this fails with exception as </p>

<pre><code>"android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."
</code></pre>

<p>Below is the basic testcase decription:-</p>

<p>testcase:-</p>

<pre><code>public void testSearch() {
                        Activity a = getActivity();
            SearchItemActivity search = new SearchItemActivity(solo);
            search.searchText("ipod", a);   

    }

 SearchItemActivity.searchText(String) is defined as

    public void searchText(final String search, Activity act) {
                Button v = (Button) act
                .findViewById(com.test.mobile.R.id.text_search_field);
                ((Button) v).setText("");
                ((Button) v).setText(search);
                solo.sendKey(Solo.ENTER);
                solo.waitForActivity("FoundItemdDetailActivity");
                solo.assertCurrentActivity("Expected FoundItemDetail activity","FoundItemdDetailActivity");
    }
</code></pre>

<p>Any suggestions how I can modify my code will be appreciatated</p>
