1. Check out our companion app, Forums for Android! Download from Google Play

Delayed instruction?

Discussion in 'App Inventor' started by Anza87, Oct 19, 2012.

  1. Anza87

    Anza87 Member
    Thread Starter
    15

    Jul 12, 2012
    12
    0
    15
    Hello,

    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());
    10.                    
    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?
     

    Advertisement

Share This Page

Loading...