Tag Archives: click

530 views

JS how to emulate click on element javascript example

  <input type="radio" name="nmRadio" id="idOne" onclick="javascript:myFc(this)">One<br> <input type="radio" name="nmRadio" id="idTwo" onclick="javascript:myFc(this)">Two<br> <input type="radio" name="nmRadio" id="idThree" onclick="javascript:myFc(this)">Three<br>   <script> if (!document.all && document.getElementById) document.getElementById(‘idTwo’).click();   function myFc(ts) { alert(ts.id); }   </script>

Posted in Javascript css html | Tagged | Comments Off on JS how to emulate click on element javascript example
15,184 views

Change TableRow background color if on row click Android example

Change table row background color if user click on row Android example code. MainActivity.java public class MainActivity extends Activity { Boolean bColorYellow = true; TextView hTextView; TableRow hTableRow; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); hTextView = (TextView)findViewById(R.id.idTextView); hTableRow … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Change TableRow background color if on row click Android example
8,450 views

ListView add item click item basic Android example code

Definition of ListView in layout main.xml file Android example   <ListView android:id="@+id/idListView" android:background="#7700CC00" android:layout_height="wrap_content" android:layout_width="fill_parent" /> Code in Main.java ListView example source code Java Android public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on ListView add item click item basic Android example code
3,234 views

Click Handler

Click Handler Android Java example source code. Open new class as activity and open URL in browser. In layout.xml file: <Button android:text="Click me" android:id="@+id/btnOpenClass" android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="@string/clickHandler"> In string.xml <string name="clickHandler">myClickHandler</string> In MainClass.java file public void myClickHandler(View view) { switch … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Click Handler