1. Tablet future looks bright! Read more about: Alcatel Xess | Samsung Galaxy View
    New Forums: Alcatel Xess | Samsung Galaxy View
    Dismiss Notice

Delayed instruction?

Last Updated:

  1. Anza87

    Anza87 Member


    I need to execute one OutputStream instruction with little delay, because may receiver is to slow for receiving second data...

    Here is the example:

    Code (Text):
    1. toggleButton2.setOnClickListener(new View.OnClickListener() {
    2.                 EditText editText1 = (EditText)findViewById(R.id.editText1);
    3.                 public void onClick(View v) {                
    4.                     if(toggleButton2.isChecked()){
    5.                         try
    6.                         {
    7.                            String t = "2";
    8.                             mmOutputStream.write(t.getBytes());
    9.                             int vrednost = Integer.parseInt(editText1.getText().toString());
    11.                          //here I need delay for example, 100ms!!
    12.                             mmOutputStream.write(vrednost);
    13.                         }
    I wrote comment where I need delay for around 100ms...Is this possible? How can I do that?


Share This Page