baobaojianqiang / contentprovider2 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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的目的就是想知道两者的却别,以及思维方式(刚买你的书看到不明白的地方,感谢大佬的书,带我进入插件化的世界)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.