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;
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
add a comment |
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
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
add a comment |
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
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
android firebase firebase-realtime-database android-wallpaper wallpapermanager
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
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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