get External Files Directory For Downloads - Android android.os

Android examples for android.os:External Storage

Description

get External Files Directory For Downloads

Demo Code

import java.io.File;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.os.Environment;

public class Main {

  @TargetApi(Build.VERSION_CODES.FROYO)//  www  .  j av  a  2s .com
  public static final File getExternalFilesDirForDownloads(Context context) {
    return context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
  }

}

Related Tutorials