Set a wallpaper from the image view retrieved from firebase - androidRetrieving Android API version programmaticallyAndroid “Only the original thread that created a view hierarchy can touch its views.”How to store and view images on firebase?I am trying to set alarm on specific time using alarm manager but alarm initiated instantly?How can I write “if button clicked” in an If statement in android studio?setText on button from another activity androidAdding Social Media Share Logic From Firebase in Androidjava.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView

What does the coin flipping before dying mean?

Why can't argument be forwarded inside lambda without mutable?

How to speed up large double sums in a table?

Huffman Code in C++

Which "exotic salt" can lower water's freezing point by –70 °C?

How to replace space with '+' symbol in a triangular array?

What is the thing used to help pouring liquids called?

Can an earth elemental drag a tiny creature underground with Earth Glide?

How to deal with employer who keeps me at work after working hours

Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?

Problem with estimating a sequence with intuition

How important are good looking people in a novel/story?

While drilling into kitchen wall, hit a wire - any advice?

As a GM, is it bad form to ask for a moment to think when improvising?

Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?

Game artist computer workstation set-up – is this overkill?

Is throwing dice a stochastic or a deterministic process?

Given a safe domain, are subdirectories safe as well?

Changing stroke width vertically but not horizontally in Inkscape

Can I combine SELECT TOP() with the IN operator?

Collision domain question

Which version of the Squat Nimbleness feat is correct?

How can I finally understand the confusing modal verb "мочь"?

Is it normal for gliders not to have attitude indicators?



Set a wallpaper from the image view retrieved from firebase - android


Retrieving Android API version programmaticallyAndroid “Only the original thread that created a view hierarchy can touch its views.”How to store and view images on firebase?I am trying to set alarm on specific time using alarm manager but alarm initiated instantly?How can I write “if button clicked” in an If statement in android studio?setText on button from another activity androidAdding Social Media Share Logic From Firebase in Androidjava.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am new to android. I want to set a wallpaper from the imageview which is retrieved from the firebase. I made a download and set button. The download button works great. The set button doesn't work. I have seen answers on Stackoverflow but they are full of built-in drawable wallpapers. so how to set the wallpaper from the imageview where the image is retrieved from the firebase



Here's the Code:



public class ViewWallActivity extends AppCompatActivity 
CollapsingToolbarLayout collapsingToolbarLayout;
Button download;
Button buttonSetWallpaper;
ImageView i1;


@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_wall);

final Target target = new Target()
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)



@Override
public void onBitmapFailed(Exception e, Drawable errorDrawable)



@Override
public void onPrepareLoad(Drawable placeHolderDrawable)


;

initialize();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(i1);


buttonSetWallpaper.setOnClickListener(new Button.OnClickListener()
@Override
public void onClick(View arg0)
Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(target);


);

download.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)

if(ContextCompat.checkSelfPermission(ViewWallActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)==PackageManager.PERMISSION_GRANTED)

String filename = UUID.randomUUID().toString() + ".png";

AlertDialog.Builder b = new AlertDialog.Builder(ViewWallActivity.this);
b.setMessage("Downloading....");
AlertDialog alertDialog =b.create();
alertDialog.show();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(new SaveImageHelper(getBaseContext(),alertDialog,getApplicationContext().getContentResolver(),filename,"Mini Image"));



else
ActivityCompat.requestPermissions(ViewWallActivity.this, new String[]Manifest.permission.WRITE_EXTERNAL_STORAGE,9);




);

private void initialize()

i1 = (ImageView)findViewById(R.id.thumbImage);

collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsingToolbarLayout);
//fabDownload = (FloatingActionButton)findViewById(R.id.fab_download);
download = (Button)findViewById(R.id.btn) ;
buttonSetWallpaper = (Button)findViewById(R.id.wallbtn);
//fabWallpaper = (FloatingActionButton)findViewById(R.id.fab_wallpaper);

collapsingToolbarLayout.setTitle(Utils.CATEGORY_SELECTED);














share|improve this question
























  • You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

    – Lalit Jadav
    Mar 23 at 4:12












  • Thanks for the answer. i will try that way. But i have created a bitmap

    – Paul Steven
    Mar 23 at 14:36


















0















I am new to android. I want to set a wallpaper from the imageview which is retrieved from the firebase. I made a download and set button. The download button works great. The set button doesn't work. I have seen answers on Stackoverflow but they are full of built-in drawable wallpapers. so how to set the wallpaper from the imageview where the image is retrieved from the firebase



Here's the Code:



public class ViewWallActivity extends AppCompatActivity 
CollapsingToolbarLayout collapsingToolbarLayout;
Button download;
Button buttonSetWallpaper;
ImageView i1;


@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_wall);

final Target target = new Target()
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)



@Override
public void onBitmapFailed(Exception e, Drawable errorDrawable)



@Override
public void onPrepareLoad(Drawable placeHolderDrawable)


;

initialize();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(i1);


buttonSetWallpaper.setOnClickListener(new Button.OnClickListener()
@Override
public void onClick(View arg0)
Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(target);


);

download.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)

if(ContextCompat.checkSelfPermission(ViewWallActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)==PackageManager.PERMISSION_GRANTED)

String filename = UUID.randomUUID().toString() + ".png";

AlertDialog.Builder b = new AlertDialog.Builder(ViewWallActivity.this);
b.setMessage("Downloading....");
AlertDialog alertDialog =b.create();
alertDialog.show();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(new SaveImageHelper(getBaseContext(),alertDialog,getApplicationContext().getContentResolver(),filename,"Mini Image"));



else
ActivityCompat.requestPermissions(ViewWallActivity.this, new String[]Manifest.permission.WRITE_EXTERNAL_STORAGE,9);




);

private void initialize()

i1 = (ImageView)findViewById(R.id.thumbImage);

collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsingToolbarLayout);
//fabDownload = (FloatingActionButton)findViewById(R.id.fab_download);
download = (Button)findViewById(R.id.btn) ;
buttonSetWallpaper = (Button)findViewById(R.id.wallbtn);
//fabWallpaper = (FloatingActionButton)findViewById(R.id.fab_wallpaper);

collapsingToolbarLayout.setTitle(Utils.CATEGORY_SELECTED);














share|improve this question
























  • You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

    – Lalit Jadav
    Mar 23 at 4:12












  • Thanks for the answer. i will try that way. But i have created a bitmap

    – Paul Steven
    Mar 23 at 14:36














0












0








0


1






I am new to android. I want to set a wallpaper from the imageview which is retrieved from the firebase. I made a download and set button. The download button works great. The set button doesn't work. I have seen answers on Stackoverflow but they are full of built-in drawable wallpapers. so how to set the wallpaper from the imageview where the image is retrieved from the firebase



Here's the Code:



public class ViewWallActivity extends AppCompatActivity 
CollapsingToolbarLayout collapsingToolbarLayout;
Button download;
Button buttonSetWallpaper;
ImageView i1;


@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_wall);

final Target target = new Target()
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)



@Override
public void onBitmapFailed(Exception e, Drawable errorDrawable)



@Override
public void onPrepareLoad(Drawable placeHolderDrawable)


;

initialize();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(i1);


buttonSetWallpaper.setOnClickListener(new Button.OnClickListener()
@Override
public void onClick(View arg0)
Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(target);


);

download.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)

if(ContextCompat.checkSelfPermission(ViewWallActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)==PackageManager.PERMISSION_GRANTED)

String filename = UUID.randomUUID().toString() + ".png";

AlertDialog.Builder b = new AlertDialog.Builder(ViewWallActivity.this);
b.setMessage("Downloading....");
AlertDialog alertDialog =b.create();
alertDialog.show();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(new SaveImageHelper(getBaseContext(),alertDialog,getApplicationContext().getContentResolver(),filename,"Mini Image"));



else
ActivityCompat.requestPermissions(ViewWallActivity.this, new String[]Manifest.permission.WRITE_EXTERNAL_STORAGE,9);




);

private void initialize()

i1 = (ImageView)findViewById(R.id.thumbImage);

collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsingToolbarLayout);
//fabDownload = (FloatingActionButton)findViewById(R.id.fab_download);
download = (Button)findViewById(R.id.btn) ;
buttonSetWallpaper = (Button)findViewById(R.id.wallbtn);
//fabWallpaper = (FloatingActionButton)findViewById(R.id.fab_wallpaper);

collapsingToolbarLayout.setTitle(Utils.CATEGORY_SELECTED);














share|improve this question
















I am new to android. I want to set a wallpaper from the imageview which is retrieved from the firebase. I made a download and set button. The download button works great. The set button doesn't work. I have seen answers on Stackoverflow but they are full of built-in drawable wallpapers. so how to set the wallpaper from the imageview where the image is retrieved from the firebase



Here's the Code:



public class ViewWallActivity extends AppCompatActivity 
CollapsingToolbarLayout collapsingToolbarLayout;
Button download;
Button buttonSetWallpaper;
ImageView i1;


@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_wall);

final Target target = new Target()
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from)



@Override
public void onBitmapFailed(Exception e, Drawable errorDrawable)



@Override
public void onPrepareLoad(Drawable placeHolderDrawable)


;

initialize();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(i1);


buttonSetWallpaper.setOnClickListener(new Button.OnClickListener()
@Override
public void onClick(View arg0)
Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(target);


);

download.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)

if(ContextCompat.checkSelfPermission(ViewWallActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE)==PackageManager.PERMISSION_GRANTED)

String filename = UUID.randomUUID().toString() + ".png";

AlertDialog.Builder b = new AlertDialog.Builder(ViewWallActivity.this);
b.setMessage("Downloading....");
AlertDialog alertDialog =b.create();
alertDialog.show();

Picasso.get().load(Utils.selected_wallpaper.getImageLink()).into(new SaveImageHelper(getBaseContext(),alertDialog,getApplicationContext().getContentResolver(),filename,"Mini Image"));



else
ActivityCompat.requestPermissions(ViewWallActivity.this, new String[]Manifest.permission.WRITE_EXTERNAL_STORAGE,9);




);

private void initialize()

i1 = (ImageView)findViewById(R.id.thumbImage);

collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsingToolbarLayout);
//fabDownload = (FloatingActionButton)findViewById(R.id.fab_download);
download = (Button)findViewById(R.id.btn) ;
buttonSetWallpaper = (Button)findViewById(R.id.wallbtn);
//fabWallpaper = (FloatingActionButton)findViewById(R.id.fab_wallpaper);

collapsingToolbarLayout.setTitle(Utils.CATEGORY_SELECTED);











android firebase firebase-realtime-database android-wallpaper wallpapermanager






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 4:13









Magnus Melwin

85111223




85111223










asked Mar 23 at 4:08









Paul StevenPaul Steven

11




11












  • You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

    – Lalit Jadav
    Mar 23 at 4:12












  • Thanks for the answer. i will try that way. But i have created a bitmap

    – Paul Steven
    Mar 23 at 14:36


















  • You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

    – Lalit Jadav
    Mar 23 at 4:12












  • Thanks for the answer. i will try that way. But i have created a bitmap

    – Paul Steven
    Mar 23 at 14:36

















You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

– Lalit Jadav
Mar 23 at 4:12






You can not directly do that, You need to retrieve bitmap with picasso and then set bitmap to wallpaper

– Lalit Jadav
Mar 23 at 4:12














Thanks for the answer. i will try that way. But i have created a bitmap

– Paul Steven
Mar 23 at 14:36






Thanks for the answer. i will try that way. But i have created a bitmap

– Paul Steven
Mar 23 at 14:36













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310527%2fset-a-wallpaper-from-the-image-view-retrieved-from-firebase-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310527%2fset-a-wallpaper-from-the-image-view-retrieved-from-firebase-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript