can't find the deactivate() function on MemoryFile class

Put your problem here if it does not fit any of the other categories.

can't find the deactivate() function on MemoryFile class

Postby wringer » Thu Aug 02, 2012 6:24 am

Hi,

I'm importing this project from another file, and everything else goes well except for this strange piece of code snippet

Code: Select all
               MemoryFile memoryFile = new MemoryFile(null, length);
               memoryFile.writeBytes(buffer, 0, 0, length);
               memoryFile.deactivate();
               return AssetFileDescriptor.fromMemoryFile(memoryFile);


eclipse complains that deactivate function does not exist in the MemoryFile class,
as well as AssetFileDescriptor not having the fromMemoryFile function.
This is strange because according to the documentation, deactivateand fromMemoryFile functions exist.
But the SDK can't seem to find them, or the android.jar doesn't seem to contain them.

I changed the "Project Build Target" on Properties->Android from Android 2.1 to 2.3 but the problem persists.
I also did a wide search on the net, but oddly enough, "nobody" has ever asked on the same problem.

Any advice? :)
Thanks.
wringer
Freshman
Freshman
 
Posts: 2
Joined: Thu Aug 02, 2012 5:54 am

Top

Re: can't find the deactivate() function on MemoryFile class

Postby wringer » Thu Aug 02, 2012 8:47 am

Sorry for double posting but got it fixed! :)
The reason was cause the two APIs were 'hidden' and I needed to customize android.jar in order to include those two functions. Customization is pretty easy once you get a good grip of it.
wringer
Freshman
Freshman
 
Posts: 2
Joined: Thu Aug 02, 2012 5:54 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 17 guests