File tree 1 file changed +20
-1
lines changed
Uploading/app/src/main/java/com/tss/uploading
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,31 @@ private void imageChooser()
82
82
catch (IOException e ) {
83
83
e .printStackTrace ();
84
84
}
85
- imageView .setImageBitmap (
85
+ IVPreviewImage .setImageBitmap (
86
86
selectedImageBitmap );
87
87
}
88
88
}
89
89
});
90
90
91
+ // this function is triggered when user
92
+ // selects the image from the imageChooser
93
+ public void onActivityResult (int requestCode , int resultCode , Intent data ) {
94
+ super .onActivityResult (requestCode , resultCode , data );
95
+
96
+ if (resultCode == RESULT_OK ) {
97
+
98
+ // compare the resultCode with the
99
+ // SELECT_PICTURE constant
100
+ if (requestCode == SELECT_PICTURE ) {
101
+ // Get the url of the image from data
102
+ Uri selectedImageUri = data .getData ();
103
+ if (null != selectedImageUri ) {
104
+ // update the preview image in the layout
105
+ IVPreviewImage .setImageURI (selectedImageUri );
106
+ }
107
+ }
108
+ }
109
+ }
91
110
}
92
111
93
112
You can’t perform that action at this time.
0 commit comments