0

I registered my app to handle SET_WALLPAPER, however, I don't know how to proper setResult so that the calling app can continue.

In my app, I have this snippet when user picks a file (to be set as wallpaper)

                    Intent intent = new Intent();
                    intent.setData( Uri.fromFile( new File( pickedFileName ));
                    if (getParent() == null) {
                        setResult(Activity.RESULT_OK, intent);
                    } else {
                        getParent().setResult(Activity.RESULT_OK, intent);
                    }

                    finish(); 

However, the calling app just quits.

My question is, 1. what's the proper way to set the result (i.e., what to fill out?) 2. do I need to crop the image in my app? If not, what to call to do the cropping?

Thanks.

  • The following thread seems to answer your question: http://stackoverflow.com/questions/13945299/is-there-any-code-to-set-wallpaper-without-cropping-and-zooming-in-android –  Sep 26 '14 at 14:30
  • Maybe I am not clear in my post, so there's another application (not mine) which wants to set wall paper, and uses a SET_WALLPAPER intent, which my app registers itself for such intent. My responsibility is to properly pass back whatever content is needed and the original app can use the result to set wallpaper (outside my control, i.e, I have no business in setting wallpaper myself, I think I only need to provide a properly cropped image in this case) – Yang Su Sep 26 '14 at 14:39
  • I think I misunderstand the intent, it's not to choose a file, but to ask the handling app to actually pick image and set wall paper. – Yang Su Sep 26 '14 at 16:42

0 Answers0