Tag Archives: handler

18,450 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
57,409 views

How update View TextView with timer Android runnable example

Update TextView by runnable. Handler, runnable, timer Android example. public class TimerActivity extends Activity { TextView hTextView; Button hButton, hButtonStop; private Handler mHandler = new Handler(); private int nCounter = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); hTextView … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on How update View TextView with timer Android runnable example
3,820 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