Example usage for android.app Activity getFileStreamPath

List of usage examples for android.app Activity getFileStreamPath

Introduction

In this page you can find the example usage for android.app Activity getFileStreamPath.

Prototype

@Override
    public File getFileStreamPath(String name) 

Source Link

Usage

From source file:org.deviceconnect.android.deviceplugin.pebble.setting.PebbleSettingActivity.java

/**
 * ? pbw ?????? uri ?./*from   w  w  w. j  a v a  2 s  .c o m*/
 * @return uri ?.
 */
@SuppressLint("WorldReadableFiles")
@SuppressWarnings("deprecation")
private static Uri getPbwFileName(final Activity activity) {
    File file = activity.getFileStreamPath("dc_pebble.pbw");
    try {
        fileCopy(activity.getResources().openRawResource(R.raw.dc_pebble),
                activity.openFileOutput(file.getName(), MODE_WORLD_READABLE));
    } catch (IOException e) {
        e.printStackTrace();
    }
    return Uri.fromFile(file);
}