We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button b1 = (Button)findViewById(R.id.imagebtn1); b1.setOnClickListener(new View.OnClickListener() { @OverRide public void onClick(View v) { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent,"select image"),RESULT_LOAD_IMAGE); } }); protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == RESULT_LOAD_IMAGE && requestCode== RESULT_OK && data.getData() !=null){ selectimage = data.getData(); try { Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),selectimage); imageE.setImageBitmap(bitmap); selectImage(); } catch (IOException e) { e.printStackTrace(); } }
super.onActivityResult(requestCode, resultCode, data); }
public void selectImage(){ StorageReference imageReference = storageReference.child(firebaseAuth.getUid()).child("Image").child("Selected Imaage"); UploadTask uploadTask = imageReference.putFile(selectimage); uploadTask.addOnFailureListener(new OnFailureListener() { @OverRide public void onFailure(@nonnull Exception e) { Toast.makeText(nav.this,"Image cant slecting",Toast.LENGTH_SHORT).show(); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @OverRide public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Toast.makeText(nav.this,"Image Selected Sucessfuly",Toast.LENGTH_SHORT).show(); } }); }
The text was updated successfully, but these errors were encountered:
how to solve this ????
Sorry, something went wrong.
No branches or pull requests
Button b1 = (Button)findViewById(R.id.imagebtn1);
b1.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"select image"),RESULT_LOAD_IMAGE);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESULT_LOAD_IMAGE && requestCode== RESULT_OK && data.getData() !=null){
selectimage = data.getData();
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),selectimage);
imageE.setImageBitmap(bitmap);
selectImage();
} catch (IOException e) {
e.printStackTrace();
}
}
public void selectImage(){
StorageReference imageReference = storageReference.child(firebaseAuth.getUid()).child("Image").child("Selected Imaage");
UploadTask uploadTask = imageReference.putFile(selectimage);
uploadTask.addOnFailureListener(new OnFailureListener() {
@OverRide
public void onFailure(@nonnull Exception e) {
Toast.makeText(nav.this,"Image cant slecting",Toast.LENGTH_SHORT).show();
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@OverRide
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Toast.makeText(nav.this,"Image Selected Sucessfuly",Toast.LENGTH_SHORT).show();
}
});
}
The text was updated successfully, but these errors were encountered: