Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

open gallery android

// Select Image From Gallery
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);

// Override this method too
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == SELECT_IMAGE) {
        if (resultCode == Activity.RESULT_OK) {
            if (data != null) {
                try {
                    Bitmap bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), data.getData());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        } else if (resultCode == Activity.RESULT_CANCELED)  {
            Toast.makeText(getActivity(), "Canceled", Toast.LENGTH_SHORT).show();
        }
    }
}
Comment

open gallery android


Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);

Comment

PREVIOUS NEXT
Code Example
Java :: java selenium send keys numbers 
Java :: android date time 
Java :: delete ending part of the string java 
Java :: foreach java 
Java :: java regex replace all characters before 
Java :: java 8 list stream delete by name 
Java :: circular textview android 
Java :: copy to clipboard android studio 
Java :: Java tree from star 
Java :: in place transpose in a matrix in java 
Java :: get today date in java 8 
Java :: vscode java.home path 
Java :: get day of week java 
Java :: java replaceall regex 
Java :: what is use of static block in java 
Java :: jsp get query parameter 
Java :: how to read a excel file in java 
Java :: permission foreground_service 
Java :: kjk;ok 
Java :: java scanner string to int 
Java :: Caused by: java.lang.RuntimeException: No installed build tools found. Install the Android build tools version 19.1.0 or higher. 
Java :: how to get input form combobox java 
Java :: double to string java 
Java :: java get bigger int 
Java :: convert arraylist to array in java 
Java :: java while loop example 
Java :: how to make java list 
Java :: sort descending java stream 
Java :: java array loop 
Java :: resize image icon to fit jlabel 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =