有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    当您绑定到Service时,只需使用生成的类:

    Intent intent = new Intent(this, MyService_.class); // note the underscore
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
    

    或者可以使用生成的Intent生成器:

    bindService(MyService_.intent(this).get(), mConnection, Context.BIND_AUTO_CREATE);