打印
[嵌入式linux]

安卓蓝牙的问题

[复制链接]
445|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
JY-DX-JY|  楼主 | 2015-10-8 17:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
myText1 = (TextView) findViewById(R.id.textView1);
                                myText1.setText("STOP:");
                                sendCmd("AAAAAA9630000101");
                                        /*Log.d("Season", "前进");*/
                                       
                                        myText1.setText("START:");

                                        byte[] tmp = new byte[5];

                                        try {
                                                 int count = InStream.available();
                                        while (count < 1)
                                        {
                                            count = InStream.available();
                                        }
                                                InStream.read(tmp, 0, 5);
                                                myText1.setText(new String(tmp, 0, 5) + " ");
                                                System.out.println(new String(tmp, 0, 5) + " ");

                                        } catch (IOException e) {
                                                e.printStackTrace();
                                               
                                        }
以上是我安卓蓝牙开发的一段代码,sendCmd("AAAAAA9630000101");
命令发送已经成功,可是myText1.setText("STOP:");STOP却不显示。
请问大神,怎么回事?谢谢!

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:晴天响霹雳,平地一声雷。

245

主题

3349

帖子

30

粉丝