小编Mak*_*nia的帖子

如何使用新的导航架构组件实现ViewPager?

我有一个BottomNavigationView和一个应用程序ViewPager.如何使用新的"导航架构组件"实现它?

什么是最佳做法?

非常感谢

android android-architecture-components

23
推荐指数
4
解决办法
5028
查看次数

java.io.IOException: [JSR82] accept: Connection is not created (failed or aborted)

我想在 Samsung GALAXY TAB 8.9 中创建 BluetoothServerSocket。(android 4.04) 当调用 mmServerSocket.accept() - 抛出:

“java.io.IOException:[JSR82] 接受:未创建连接(失败或中止)。”

我阅读了许多类似的文章,但还没有详细的答案。也许有人解决了类似的问题,或者知道这个异常是什么意思。

谢谢。

代码来自android 示例“ChatExample”:

     public  class AcceptThread extends Thread {
    // The local server socket
    private final BluetoothServerSocket mmServerSocket;
    private String mSocketType;

    public AcceptThread(boolean secure) {            BluetoothServerSocket tmp = null;
        mSocketType = secure ? "Secure" : "Insecure";

        try {
                tmp = mAdapter.listenUsingInsecureRfcommWithServiceRecord(
                        NAME_INSECURE, MY_UUID_INSECURE);

        } catch (IOException e) {
            Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
        }
        mmServerSocket = tmp;
    } …
Run Code Online (Sandbox Code Playgroud)

android bluetooth

5
推荐指数
0
解决办法
1851
查看次数