Android : Set Wallpaper in whatsapp after getting the path

on Thursday, March 19, 2015


I am following this answer to accomplish my task. Everything works well except the last part,



if(result!=null)
{

Toast.makeText(getApplicationContext(), "Image saved in Gallery !", Toast.LENGTH_LONG).show();

if(isinint) //check if any app cares for the result
{
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND, Uri.fromFile(new File(result.toString()))); //Create a new intent. First parameter means that you want to send the file. The second parameter is the URI pointing to a file on the sd card. (openprev has the datatype File)

((Activity) ImageListActivity.this).setResult(Activity.RESULT_OK, shareIntent); //set the file/intent as result
((Activity) ImageListActivity.this).finish(); //close your application and get back to the requesting application like GMail and WhatsApp
return; //do not execute code below, not important
}
}


At last nothing crash but wallpaper is also not set in whatsapp.


Can anyone please let me know why it is not working?


Any help is appriciated.


Thanks


0 comments:

Post a Comment