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.