Code Monkey home page Code Monkey logo

contentprovider2's Introduction

contentprovider2's People

Contributors

baojianqiang avatar

Stargazers

赵宝鹏 avatar

Watchers

James Cloos avatar 包建强 avatar

contentprovider2's Issues

为什么不直接使用android.content.pm.PackageParser.Provider反射里面的info获取到ProviderInfo呢

API:23的源码
public final static class Provider extends Component {
public final ProviderInfo info;
public boolean syncable;

    public Provider(final ParseComponentArgs args, final ProviderInfo _info) {
        super(args, _info);
        info = _info;
        info.applicationInfo = args.owner.applicationInfo;
        syncable = false;
    }
    
    public Provider(Provider existingProvider) {
        super(existingProvider);
        this.info = existingProvider.info;
        this.syncable = existingProvider.syncable;
    }

    public void setPackageName(String packageName) {
        super.setPackageName(packageName);
        info.packageName = packageName;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(128);
        sb.append("Provider{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append(' ');
        appendComponentShortName(sb);
        sb.append('}');
        return sb.toString();
    }
}

直接通过反射android.content.pm.PackageParser.Provider反射里面的info得到想要的ProviderInfo不是更简单。我发这个issue的目的就是想知道两者的却别,以及思维方式(刚买你的书看到不明白的地方,感谢大佬的书,带我进入插件化的世界)

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.