• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Delayed instruction?

Anza87

Newbie
Jul 12, 2012
11
0
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:
toggleButton2.setOnClickListener(new View.OnClickListener() {
                EditText editText1 = (EditText)findViewById(R.id.editText1);
                public void onClick(View v) {                
                   
                    if(toggleButton2.isChecked()){
                        try 
                        {
                            
                            String t = "xxxx";
                            mmOutputStream.write(t.getBytes());
                            int vrednost = Integer.parseInt(editText1.getText().toString());
                            //delay 100ms
                            mmOutputStream.write(vrednost);
                            }catch (IOException ex) { }
I wrote comment where I need delay for around 100ms...Is this possible? How can I do that?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones