Giter Site home page Giter Site logo

control == null about starrysky HOT 25 CLOSED

espoirx avatar espoirx commented on May 22, 2024
control == null

from starrysky.

Comments (25)

EspoirX avatar EspoirX commented on May 22, 2024

看看你是怎么使用的?

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

按照步骤application初始化,
然后
SongInfo songInfo2 = new SongInfo();
songInfo2.setSongId("id"+musicStateBean.getLocation());
songInfo2.setSongUrl(musicStateBean.getSong().path);
MusicManager.get().playMusicByInfo(songInfo2);

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

qq 20180423152351

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

不会是服务没起来吧,你看看有没有:musiclibrary进程,因为是在 ServiceConnection 里面赋值的

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

我看看

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

你断点一下第143行,看看ServiceConnection里面有没有赋值

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

qq 20180423153905
没有跑到

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

这么神奇吗,你再断下137行,看看有没有bindService

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

qq 20180423154217

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

刚刚我在demo中试了一下,是没问题的。你这里很奇怪,它绑定了服务还不走 onServiceConnected 回调这么神奇

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

qq 20180423154834
我刚刚自己写了个服务是可以绑定回调的,是不是要AndroidManifest注册?

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

不需要自己注册,我里面都注册好了。
我觉得可以试试下面的做法:
第一个看看服务启动了没有,看看有没有musiclibrary进程。
第二个可以先clone代码,先用library的方式引用,方便调试问题所在
第三个,我是在NiceMusic这个demo里面测试的,没重现到问题,你也可以看看

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

本地引用库,一样没回调,额(⊙﹏⊙)

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

你的NiceMusic应该是用AndroidStudio3.0+开发的,我花了点功夫刚移植到AndroidStudio2.3,现在测试体体

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

现在都用3.0了吧,我用3.0.1的

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

用惯2.3.3,我个人不太喜欢3.0的调试器,还有一些项目都是2.3.3开发的,出问题麻烦,所以没用,不过我装了最新的as预览版

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

你的项目的确可以回调的,奇怪

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

不知道你是不是设置了什么其他东西影响到了……

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

吖,用不了

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

我刚刚开了一个新demo,也不可以,没有回调,你也试试创建一个新的demo,引用,然后application断init里面的回调

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

我创建一个试试

from starrysky.

EspoirX avatar EspoirX commented on May 22, 2024

试了,没问题,你直接在你的主activity里面初始化,看看 control 还是不是null 试试
qq 20180423171939
你加我qq吧,方便一点

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

qq1023509177

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

implementation 'com.android.support:appcompat-v7:26.1.0'
27+版本抛null

from starrysky.

Deepblue1996 avatar Deepblue1996 commented on May 22, 2024

27+, 需要额外引用
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'

from starrysky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.