select photo from camera android
Java
private void pickFromGallery(){
//Create an Intent with action as ACTION_PICK
Intent intent=new Intent(Intent.ACTION_PICK);
// Sets the type as image/*. This ensures only components of type image are selected
intent.setType("image/*");
//We pass an extra array with the accepted mime types. This will ensure only components with these MIME types as targeted.
String[] mimeTypes = {"image/jpeg", "image/png"};
intent.putExtra(Intent.EXTRA_MIME_TYPES,mimeTypes);
// Launching the Intent
startActivityForResult(intent,GALLERY_REQUEST_CODE);
}
public void onActivityResult(int requestCode,int resultCode,Intent data){
// Result code is RESULT_OK only if the user selects an Image
if (resultCode == Activity.RESULT_OK)
switch (requestCode){
case GALLERY_REQUEST_CODE:
//data.getData returns the content URI for the selected Image
Uri selectedImage = data.getData();
imageView.setImageURI(selectedImage);
break;
}
}
Also in Java:
- Title
- find the triplet sum in java linked list
- Category
- Java
- Title
- how to init an array with objects in java
- Category
- Java
- Title
- try block in java
- Category
- Java
- Title
- how to create a JFrame in java
- Category
- Java
- Title
- replace all punctuation in string java
- Category
- Java
- Title
- java fx display simple rectangle
- Category
- Java
- Title
- how to find the divisors of a number in java
- Category
- Java
- Title
- hashmaps java
- Category
- Java
- Title
- esponente in java
- Category
- Java
- Title
- java null pointer exception
- Category
- Java
- Title
- How to make a class in Java?
- Category
- Java
- Title
- java processbuilder example
- Category
- Java
- Title
- iterator for array java
- Category
- Java
- Title
- input java
- Category
- Java
- Title
- how to convert string to double in android studio
- Category
- Java
- Title
- how to call a static method in java
- Category
- Java
- Title
- add video in bootstrap
- Category
- Java
- Title
- double to string java
- Category
- Java
- Title
- java file path linux
- Category
- Java
- Title
- tostring() java example
- Category
- Java
- Title
- java literals w3schools
- Category
- Java
- Title
- continue in java
- Category
- Java
- Title
- has places api got deprecated???
- Category
- Java
- Title
- array rotation program in java
- Category
- Java
- Title
- difference between java and javascript
- Category
- Java
- Title
- countdown timer with seekbar
- Category
- Java
- Title
- java switch display panel
- Category
- Java
- Title
- how to check internet is working or not in java
- Category
- Java
- Title
- vector in java
- Category
- Java
- Title
- java manacher's algorithm
- Category
- Java
- Title
- jenkins decrypt password script console
- Category
- Java
- Title
- How can I put a parameter into a localized string in Android?
- Category
- Java
- Title
- system.out.println shortcut
- Category
- Java
- Title
- java insert into arraylist
- Category
- Java
- Title
- arraylist remove method java
- Category
- Java
- Title
- how to run java program in linux server
- Category
- Java
- Title
- java enum
- Category
- Java
- Title
- iterate trough linked list java
- Category
- Java
- Title
- java boolean zen
- Category
- Java
- Title
- java permutation
- Category
- Java
- Title
- list java oracle
- Category
- Java
- Title
- get cursor position in textarea java
- Category
- Java
- Title
- generate a qr code in java
- Category
- Java
- Title
- mock ParameterizedTypeReference
- Category
- Java
- Title
- how timer class and display to jtextfield w3schools in java
- Category
- Java
- Title
- loop an array of objects in java
- Category
- Java
- Title
- for loop in java stack overflow
- Category
- Java
- Title
- checking if a given integer is a prime number java
- Category
- Java
- Title
- java split for multiple characters
- Category
- Java
- Title
- java.lang.UnsupportedOperationException
- Category
- Java
- Title
- sublist in java
- Category
- Java
- Title
- java boolean even number
- Category
- Java
- Title
- spring framework iterate
- Category
- Java
- Title
- how to install java runtime environment on centos 7
- Category
- Java
- Title
- finding min and max from given number in java
- Category
- Java
- Title
- javafx detect collision
- Category
- Java
- Title
- JavaFX onMouseEntered
- Category
- Java
- Title
- list java replace
- Category
- Java
- Title
- count word in string no matter the delimiter java
- Category
- Java
- Title
- import scanner
- Category
- Java
- Title
- java stream order by property
- Category
- Java
- Title
- javafx textarea how to make smaller
- Category
- Java
- Title
- intellij replace all
- Category
- Java
- Title
- JSONObject java
- Category
- Java
- Title
- how to declare string array in java
- Category
- Java
- Title
- how to get a user to add to an arraylist in java
- Category
- Java
- Title
- online money transfer andhra bank
- Category
- Java
- Title
- are strings modifiable
- Category
- Java
- Title
- java check if args is empty
- Category
- Java
- Title
- java comparable
- Category
- Java
- Title
- how to detect device javascirpt
- Category
- Java
- Title
- Java how to handle HTTP GET request after establishing TCP connection
- Category
- Java
- Title
- if and in java
- Category
- Java
- Title
- java observable to observer
- Category
- Java
- Title
- java initialize int array
- Category
- Java
- Title
- import java.util.hashset
- Category
- Java
- Title
- Java.awt graphics tutorial
- Category
- Java
- Title
- primitive and non primitive data types in java
- Category
- Java
- Title
- java setter
- Category
- Java
- Title
- how to make generic arraylist in java
- Category
- Java
- Title
- add two numbers bitwise
- Category
- Java
- Title
- sdkmanager JAVA_HOME invalid directory
- Category
- Java
- Title
- java jpa criteriabuilder in xample
- Category
- Java
- Title
- java nextpermutation
- Category
- Java
- Title
- java random between two strings
- Category
- Java
- Title
- how to compare string in java
- Category
- Java
- Title
- arraylist to array java
- Category
- Java
- Title
- how to check if rs next is null
- Category
- Java
- Title
- count occurrences of character in string java 8
- Category
- Java
- Title
- print a letter in java
- Category
- Java
- Title
- parseints(str) java
- Category
- Java
- Title
- initialize applet in java
- Category
- Java
- Title
- change color of particular row in jtable
- Category
- Java
- Title
- java create txt file
- Category
- Java
- Title
- java replaceall single character
- Category
- Java
- Title
- java convert String to int
- Category
- Java
- Title
- kotlin jsonobject get nested
- Category
- Java
- Title
- how take inputs in java with message
- Category
- Java
- Title
- java check if directory exists
- Category
- Java
- Title
- how to select a random element from an array in java
- Category
- Java