I just create one code snippet to save one Image from internet to SD card using the follow code, after that, I want to open the gallery app to view this Image.
URL url = new URL(address); BufferedInputStream bis = new BufferedInputStream(is); String sdurl = Media.insertImage(getContentResolver(), bm, "pic1", null); |
How to Start the Gallery app and show this Image?
Intent intent = new Intent(Intent.ACTION_VIEW); |
If you don’t know how to start a system activity, here is the trick, using the aapktool
basically, pull the apk from the Phone using the DDMS file browser plug-in, here I am pulling out the gallery apk located in /syste/app/*.apk
Download the extract the appktool. then run aapt.
here is the trick, all activity has the AndroidManifest.xml, in that xml, you can find all the declared intent filters to start this activity. By default , this file is compressed. so you need the appt tool to decompress it. here is how.
aapt dump xmltree Gallery3DGoogle.apk AndroidManifest.xml >a.txt |
then in the a.txt, you can see all the declared intent. I just pickup the view one.
No comments:
Post a Comment