Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:53:38+00:00 2026-05-31T15:53:38+00:00

I would like to know if it’s possible to create an Intent that makes

  • 0

I would like to know if it’s possible to create an Intent that makes the gallery cropper show wallpaper highlighting. This feature has been introduced in Honeycomb. To get an idea of what I’m looking for have a look at the tablet on the image (the three blue rectangles).

I had a look at the source code of the ICS gallery app, but I couldn’t find what I’m looking for.

this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:53:39+00:00Added an answer on May 31, 2026 at 3:53 pm

    I would like to know if it’s possible to create an Intent that makes
    the gallery cropper show wallpaper highlighting.

    Assuming you want your app to behave properly across all Android devices, the answer is no. Neither the cropping activity nor the highlighted crop-view is part of the public API; both are internal to the Gallery 3D app. In other words, you could spend all the time in the world trying to find an Intent action to get this to magically work for you, but the fact is that some devices simply won’t support it. For example, many devices, such as the HTC Sense and Samsung Galaxy, have customized Android versions that have their own gallery app. Since these Gallery apps are specific to the companies that designed them, these devices won’t necessarily have a CropImage class for you to launch.

    That being said, in order to guarantee that your application works across all devices, you’ll have to incorporate the cropping code directly into your project. And if for some reason you find a way to launch the crop activity with an Intent, you should test to see whether the com.android.gallery3d package exists at the very least, and handle it somehow.

    I have included below a work-around that might help you incorporate the Android code into your project. I don’t currently have access to a tablet running Honeycomb/ICS so I can’t be more specific with regards to how to get it working on newer versions of Android, but I imagine it involves similar analysis and a bit of copying and pasting from the com.android.gallery3d package.


    Reusing the “Crop Activity” on Android 2.x

    I tested this on my Nexus One and just before the soft “crop-rectangle” popped up, I got the following logcat output:

    I/ActivityManager(   94): Starting: Intent { 
        act=android.intent.action.CHOOSER 
        cmp=android/com.android.internal.app.ChooserActivity (has extras) } from pid 558
    I/ActivityManager(   94): Starting: Intent { 
        act=android.intent.action.ATTACH_DATA 
        dat=content://media/external/images/media/648 
        typ=image/jpeg 
        flg=0x3000001 
        cmp=com.google.android.gallery3d/com.cooliris.media.Photographs (has extras) } from pid 558
    I/ActivityManager(   94): Starting: Intent { 
        dat=content://media/external/images/media/648 
        cmp=com.google.android.gallery3d/com.cooliris.media.CropImage (has extras) } from pid 558
    

    So from what I can tell, the sequence of events that occurs when you perform this action is as follows:

    1. You navigate to an image in the gallery and select “set as…”. An ActivityChooser pops up and you select “Wallpaper”.
    2. This selection fires an Intent with action ATTACH_DATA and component com.cooliris.media.Photographs, which is a class in the Android framework that serves as a “wallpaper picker” for the camera application; it just redirects to the standard pick action. Since we have given the Intent a URI that specifies the image to set as the wallpaper, this class will inevitably execute the following code (see the class’s onResume method):

      Intent intent = new Intent();   
      intent.setClass(this, CropImage.class);
      intent.setData(imageToUse);
      formatIntent(intent);
      startActivityForResult(intent, CROP_DONE);
      
    3. This fires another Intent that starts the CropImage Activity… this is where you specify the cropped area using the soft-rectangle. When you specify the crop, the result is set to RESULT_OK with requestCode = CROP_DONE. The Photographs Activity switch-cases over these two constants and then sets the wallpaper accordingly (see the Photographs class’s onActivityResult method).

    Unfortunately, for whatever reason the Android team decided to removed these functionalities from the SDK beginning with API 4 (Android v1.6)… so if you wanted to fire an Intent to perform these exact sequence of events, it would require you to sift through the com.cooliris.media package, and to copy and paste the relevant classes into your project. In my past experience, doing this is often more trouble than it is worth (unless it is to perform a relatively simple action) but it is definitely possible.

    Here is a nice tutorial on how you might go about simplifying the process… it requires you to copy and paste 12 Java classes into your project as opposed to the entire com.cooliris.media package. These classes together should be enough to correctly fire up the CropImage Activity, but you will have to set the wallpaper manually upon the CropImage Activity’s result.

    Also note that the sample code provided assumes that you want to crop immediately after a picture is taken by the camera. In order to, for example, start the CropImage Activity with a pre-selected image from the gallery, you’d call,

    Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(i, ACTIVITY_SELECT_IMAGE);
    

    and then in onActivityResult, (if requestCode == ACTIVITY_SELECT_IMAGE and resultCode == RESULT_OK), launch the CropImage Activity with the Uri data given in the onActivityResult‘s third argument (see the sample code for an example on how to launch the Activity).

    If anything, hopefully this will help point you in the right direction. Let me know how it goes and leave a comment if you want me to clarify anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like know if it is possible to create embedding of audio message
I would like know the limit of maximum number of rows that can be
This is possibly a candidate for a one-line answer. I would like know it
Would like to know if there is any resource on the web that conveniently
would like to know how can this be implemented in Joomla. I have a
i would like know how to build a rss feed that is evergoing using
I would like know what is the best possible way to implement transactions with
Would like to know create drop shadow for UINavigationbar. I tried to create custom
Would like to know when to use, This applies for what browser ? if
Would like to know how it is possible to rewrite www.site.com/?lang=de to www.site.com/de in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.