get Out Temp Media File - Android Media

Android examples for Media:Media File

Description

get Out Temp Media File

Demo Code


//package com.java2s;

import java.io.File;

import android.os.Environment;

public class Main {
    public static final String TEMP_PIC_PATH = "asdf/PhotoTemp";

    public static File getOutTempMediaFile() {
        File mediaStorageDir = new File(
                Environment.getExternalStorageDirectory(), TEMP_PIC_PATH);

        File tempMediaFile = null;
        if (mediaStorageDir.exists()) {
            tempMediaFile = new File(mediaStorageDir.getPath()
                    + File.separator + "IMG_TEMP.jpg");
        }//  ww  w  .  j  a  va2 s.  c o m

        return tempMediaFile;
    }
}

Related Tutorials