How to get url image from firebase and save it in string?How to save an Android Activity state using save instance state?How can I open a URL in Android's web browser from my application?Is there a way to get the source code from an APK file?Android AlarmManager for periodical sensor readingHow to get the build/version number of your Android application?setText on button from another activity androidget around of error 'can not resolve symbol'Saving ToggleButton state in ListView by using SharedPreferencesHow to get the data saved in a USER_ID?
Can you use Apple Care+ without any checks (bringing just MacBook)?
Can UV radiation be safe for the skin?
What is the chance of getting a Red Cabbage in year 1?
How to save money by shopping at a variety of grocery stores?
Why do presidential pardons exist in a country having a clear separation of powers?
Do universities maintain secret textbooks?
Can authors email you PDFs of their textbook for free?
What is the practical impact of using System.Random which is not cryptographically random?
Using font to highlight a god's speech in dialogue
Why does the U.S. military maintain their own weather satellites?
How many possible file types in the output `ls -l` command?
New coworker has strange workplace requirements - how should I deal with them?
Can a human variant take proficiency in initiative?
Who declared the Last Alliance to be the "last" and why?
How to run a command 1 out of N times in Bash
Which is the correct version of Mussorgsky's Pictures at an Exhibition?
Heavy Box Stacking
I failed to respond to a potential advisor
Did NASA/JPL get "waning" and "waxing" backwards in this video?
An idiom for “Until you punish the offender, they will not give up offenses”
A vector is defined to have a magnitude and *a* direction, but the zero vector has no *single* direction. So, how is the zero vector a vector?
Doubt about a particular point of view on how to do character creation
Padding a column of lists
How is the anglicism "jackpot" commonly expressed in French?
How to get url image from firebase and save it in string?
How to save an Android Activity state using save instance state?How can I open a URL in Android's web browser from my application?Is there a way to get the source code from an APK file?Android AlarmManager for periodical sensor readingHow to get the build/version number of your Android application?setText on button from another activity androidget around of error 'can not resolve symbol'Saving ToggleButton state in ListView by using SharedPreferencesHow to get the data saved in a USER_ID?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How I can get a String url from:
StorageReference file_path = mStorageReference.child("Posts_images")
.child(currentUser + ".jpg");
file_path.putFile(pickedImageUri).addOnCompleteListener(new OnCompleteListener <UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful())
//
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
finish();
android
add a comment |
How I can get a String url from:
StorageReference file_path = mStorageReference.child("Posts_images")
.child(currentUser + ".jpg");
file_path.putFile(pickedImageUri).addOnCompleteListener(new OnCompleteListener <UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful())
//
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
finish();
android
add a comment |
How I can get a String url from:
StorageReference file_path = mStorageReference.child("Posts_images")
.child(currentUser + ".jpg");
file_path.putFile(pickedImageUri).addOnCompleteListener(new OnCompleteListener <UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful())
//
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
finish();
android
How I can get a String url from:
StorageReference file_path = mStorageReference.child("Posts_images")
.child(currentUser + ".jpg");
file_path.putFile(pickedImageUri).addOnCompleteListener(new OnCompleteListener <UploadTask.TaskSnapshot>() {
@Override
public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
if (task.isSuccessful())
//
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
finish();
android
android
edited Mar 30 at 0:21
Jason Aller
3,24710 gold badges32 silver badges33 bronze badges
3,24710 gold badges32 silver badges33 bronze badges
asked Mar 27 at 23:55
Ali QadomyAli Qadomy
62 bronze badges
62 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Inside the if statement where the task is successul you can get the downloadUrl like this:
if (task.isSuccessful())
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
file_path.getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
String url = uri.toString();
//do stuff
).addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
// Handle any errors
);
Documentation for more information Firebase docs
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
add a comment |
You need to use this
.addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
Uri downloadUri = task.getResult();
if (downloadUri != null)
String photoStringUrl = downloadUri.toString();
);
add a comment |
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%2f55388216%2fhow-to-get-url-image-from-firebase-and-save-it-in-string%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Inside the if statement where the task is successul you can get the downloadUrl like this:
if (task.isSuccessful())
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
file_path.getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
String url = uri.toString();
//do stuff
).addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
// Handle any errors
);
Documentation for more information Firebase docs
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
add a comment |
Inside the if statement where the task is successul you can get the downloadUrl like this:
if (task.isSuccessful())
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
file_path.getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
String url = uri.toString();
//do stuff
).addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
// Handle any errors
);
Documentation for more information Firebase docs
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
add a comment |
Inside the if statement where the task is successul you can get the downloadUrl like this:
if (task.isSuccessful())
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
file_path.getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
String url = uri.toString();
//do stuff
).addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
// Handle any errors
);
Documentation for more information Firebase docs
Inside the if statement where the task is successul you can get the downloadUrl like this:
if (task.isSuccessful())
String msg = getString(R.string.imageUploadSuccessfully);
Toast.makeText(AddPost_Activity.this, msg, Toast.LENGTH_SHORT).show();
file_path.getDownloadUrl().addOnSuccessListener(new
OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
String url = uri.toString();
//do stuff
).addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
// Handle any errors
);
Documentation for more information Firebase docs
edited Mar 28 at 0:09
answered Mar 27 at 23:57
bensadikubensadiku
3331 silver badge10 bronze badges
3331 silver badge10 bronze badges
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
add a comment |
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I use .addOnCompleteListener ??
– Ali Qadomy
Mar 28 at 0:01
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
I'm not sure what you mean by that. You should use .onSuccess listener or the getDownloadUrl()..
– bensadiku
Mar 28 at 0:02
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
Updated the code to fit your pasta
– bensadiku
Mar 28 at 0:09
add a comment |
You need to use this
.addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
Uri downloadUri = task.getResult();
if (downloadUri != null)
String photoStringUrl = downloadUri.toString();
);
add a comment |
You need to use this
.addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
Uri downloadUri = task.getResult();
if (downloadUri != null)
String photoStringUrl = downloadUri.toString();
);
add a comment |
You need to use this
.addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
Uri downloadUri = task.getResult();
if (downloadUri != null)
String photoStringUrl = downloadUri.toString();
);
You need to use this
.addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
Uri downloadUri = task.getResult();
if (downloadUri != null)
String photoStringUrl = downloadUri.toString();
);
edited Mar 28 at 0:29
answered Mar 28 at 0:19
Mustafa ShahoudMustafa Shahoud
367 bronze badges
367 bronze badges
add a comment |
add a comment |
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%2f55388216%2fhow-to-get-url-image-from-firebase-and-save-it-in-string%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