Click here to Skip to main content
15,904,155 members
Home / Discussions / Android
   

Android

 
QuestionManage auto update Pin
Andy_Bell26-Sep-16 6:20
Andy_Bell26-Sep-16 6:20 
AnswerRe: Manage auto update Pin
Afzaal Ahmad Zeeshan26-Sep-16 6:50
professionalAfzaal Ahmad Zeeshan26-Sep-16 6:50 
GeneralRe: Manage auto update Pin
Andy_Bell28-Sep-16 10:31
Andy_Bell28-Sep-16 10:31 
QuestionMake a call from my contact list Pin
Member 1275186521-Sep-16 2:04
Member 1275186521-Sep-16 2:04 
AnswerRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 2:30
mveRichard MacCutchan21-Sep-16 2:30 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:23
Member 1275186521-Sep-16 20:23 
GeneralRe: Make a call from my contact list Pin
Richard MacCutchan21-Sep-16 22:06
mveRichard MacCutchan21-Sep-16 22:06 
GeneralRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 22:23
Member 1275186521-Sep-16 22:23 
QuestionRe: Make a call from my contact list Pin
David Crow21-Sep-16 6:32
David Crow21-Sep-16 6:32 
AnswerRe: Make a call from my contact list Pin
Member 1275186521-Sep-16 20:27
Member 1275186521-Sep-16 20:27 
QuestionRe: Make a call from my contact list Pin
David Crow22-Sep-16 2:23
David Crow22-Sep-16 2:23 
QuestionAndroid - Information leakage flaw OutputStream Pin
Member 1235809712-Sep-16 21:24
Member 1235809712-Sep-16 21:24 
QuestionRe: Android - Information leakage flaw OutputStream Pin
David Crow13-Sep-16 3:23
David Crow13-Sep-16 3:23 
AnswerRe: Android - Information leakage flaw OutputStream Pin
Afzaal Ahmad Zeeshan13-Sep-16 7:10
professionalAfzaal Ahmad Zeeshan13-Sep-16 7:10 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 20:56
Member 1235809720-Sep-16 20:56 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Richard MacCutchan20-Sep-16 22:16
mveRichard MacCutchan20-Sep-16 22:16 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 23:46
Member 1235809720-Sep-16 23:46 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809720-Sep-16 23:55
Member 1235809720-Sep-16 23:55 
here is the complete code ,

        Bitmap bitmap = null;
        Uri uri = null;
if (destType == FILE_URI || destType == NATIVE_URI) {
            if (this.saveToPhotoAlbum) {
                Uri inputUri = getUriFromMediaStore();
                try {
                    //Just because we have a media URI doesn't mean we have a real file, we need to make it
                    uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova)));

                } catch (NullPointerException e) {
                    uri = null;
                }
            } else {
                uri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg"));
            }

            if (uri == null) {
                this.failPicture("Error capturing image - no media storage found.");
                return;
            }

            // If all this is true we shouldn't compress the image.
            if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
                    !this.correctOrientation) {
                writeUncompressedImage(uri);

                this.callbackContext.success(uri.toString());
            } else {
                bitmap = getScaledBitmap(FileHelper.stripFileProtocol(imageUri.toString()));

                if (rotate != 0 && this.correctOrientation) {
                    bitmap = getRotatedBitmap(rotate, bitmap, exif);
                }
// warning is for below line ,
                try (OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri)) {

                    bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);

                }


i tried using try resource but no luck still getting warning:
try (OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri))

GeneralRe: Android - Information leakage flaw OutputStream Pin
Richard MacCutchan21-Sep-16 1:57
mveRichard MacCutchan21-Sep-16 1:57 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Member 1235809721-Sep-16 3:13
Member 1235809721-Sep-16 3:13 
GeneralRe: Android - Information leakage flaw OutputStream Pin
Richard MacCutchan21-Sep-16 3:37
mveRichard MacCutchan21-Sep-16 3:37 
QuestionInvestigate Which App controls Infrared???? Pin
Member 127177612-Sep-16 13:54
Member 127177612-Sep-16 13:54 
JokeRe: Investigate Which App controls Infrared???? Pin
Richard MacCutchan2-Sep-16 21:10
mveRichard MacCutchan2-Sep-16 21:10 
GeneralRe: Investigate Which App controls Infrared???? Pin
Member 127177613-Sep-16 6:16
Member 127177613-Sep-16 6:16 
GeneralRe: Investigate Which App controls Infrared???? Pin
Richard MacCutchan3-Sep-16 6:29
mveRichard MacCutchan3-Sep-16 6:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.