Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic jump to a tab and change its content at the same time?
    primarykey
    data
    text
    <p>In the first tab I have a listview from where I extract a string, and in the second tab I have a textview. When i click an item in the list, I should go in the second tab and and the string value should be displayed in the textview. </p> <pre><code>public static String mystring; protected void onListItemClick (ListView l, View v, int position, long id){ super.onListItemClick(l, v, position, id); mystring = listofHashMap.get(position).get("keyname").toString(); //it's ok here Intent intent=new Intent(this, MyActivity.class); startActivity(intent); } </code></pre> <p>The code above(placed in ListViewActivity) is what i have tried and it works (but <em>MyActivity</em> is not anymore a tabcontent,it is a full-screen standalone activity), having the following code snippet in MyActivity:</p> <pre><code>tv = (TextView)findViewById(R.id.tvid); lv = new ListViewActivity(); tv.setText(lv.mystring); </code></pre> <p>But, as I said I want that <em>MyActivity</em> to be a tabcontent,so I have tried this:</p> <pre><code> public MyTabActivity taba = new MyTabActivity(); protected void onListItemClick (ListView l, View v, int position, long id){ super.onListItemClick(l, v, position, id); mystring = listofHashMap.get(position).get("keyname").toString(); int i=1;//the tab where I want to go, and MyActivity is its content taba.ChangeTab(i); } </code></pre> <p><em>ChangeTab()</em> is a <strong>static</strong> method within <em>MyTabActivity</em>(the activity that extends TabActivity ) which simply does <strong>setCurrentTab(i)</strong> .</p> <p>So, doing this, <em>MyActivity</em> will always display the name of first clicked item, even I select other items in the list then.I belive that what i have to do is <strong>setContent()</strong> again for <em>MyActivity</em> or do something with that <strong>static String mystring</strong>, I have tried many solutions but with no result. I tried to be as accurate I could on what i want to do, please some help on this issue.</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. 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