0
private Context mContext;
public Upload(Context context, DropboxAPI<?> api, String dropboxPath)
{
// We set the context this way so we don't accidentally leak activities
mContext = context.getApplicationContext();
String outPath = mContext.getExternalStorageDirectory(null).getAbsolutePath() + "/" +"a1.jpg";
錯誤:方法getExternalStorageDirectory()是未定義的類型上下文getExternalStorageDirectory()不被識別
String outPath = mContext.getExternalFilesDir("mnt/sdcard").getAbsolutePath() + "/" +"a1.jpg";
工作正常..
其靜態的環境類沒有上下文http://stackoverflow.com/questions/5453708/android-how-to-use-environment- getexternalstoragedirectory – Slartibartfast