android - setting wallpaper through code -


I was trying to create an app with the user he wants to he set was to choose wallpaper. I call the gallery effect previews for the user by setting've managed it once user Cvivr after selecting a specific image, the image data path is brought back to me, which is the image preview.

The problem occurs when the size of the image (and / or resolution) is higher than Android's. This is the result of the failure of my module.

And as if this was not enough, the user Some other wallpaper tries to select (and also in the case of my test "other" wallpaper size> 700kb) app "Autofmmeri Apeshn "" ...

Help me out here guys!

Gallery effect I use:

  effect intended = new intent (for); intent.setType ( "image / *"); intent.setAction (Intent.ACTION_GET_CONTENT); StartActivityForResult (Intent.createChooser (effect, select "picture"), SELECT_IMAGE);  

I Wallpaper To use:

InputStream = getContentResolver (). OpenInputStream (Uri.parse (uri_returned_from_intent)); bitmap Bijiaimej = Bitmapfintr. Sikodstrym (is); // Autofmmeri been error put here Setblok (Bijiaimej);

So I have 2 problems to work on:

  1. How to crop the image before setting it as wallpaper ...
  2. < Li> I think the outoffimateMeri exception is thrown, none of my image size is more than 1MB ... and I think if N1 has 24 MB in the VM budget, then the M.M will not be wrong ...

You should decode with the inSampleSize option to reduce memory consumption.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -