Failed To Read Image File From Assets Folder And Share It Using Intent In Android?
Following this tutorial to read image from assets folder.Here is the link Link to read image from Assets folder Contentclass extends from ContentProvider but i am getting error on
Solution 1:
ContentProvider is an abstract class. That means that it has definitions for certain methods but does not provide an implementation for them. Therefore when you extend ContentProvider, you need to provide implementations of these methods in your class (even if you have no intention of calling them in your code). This is what the tutorial means when it says "implement stubs for the needed abstract methods" and also what your compile errors are referring to.
You can implement them by adding the following to your class:
@Overridepublic int delete(Uri arg0, String arg1, String[] arg2) {
return0;
}
@OverridepublicStringgetType(Uri arg0) {
returnnull;
}
@OverridepublicUriinsert(Uri arg0, ContentValues arg1) {
returnnull;
}
@OverridepublicbooleanonCreate() {
returnfalse;
}
@OverridepublicCursorquery(Uri arg0, String[] arg1, String arg2, String[] arg3, String arg4) {
returnnull;
}
@Overridepublic int update(Uri arg0, ContentValues arg1, String arg2, String[] arg3) {
return0;
}
These are referred to as 'stubs' because they aren't do any processing as such (other than returning a null/zero/false value).
Post a Comment for "Failed To Read Image File From Assets Folder And Share It Using Intent In Android?"