-1
現在一直在尋找此問題約一週。 如何檢查第三方應用程序是否已請求我的應用程序存儲文件夾的讀/寫權限?檢查我的應用程序文件夾是否已被訪問
我想到的是:
private String TAG = "concernedClass";
private boolean myAppIsRunning;
//myAppIsRunning is set true when the app is in foreground
if(myAppIsRunning){
//do something
}else if(!myAppIsRunning && (/*code to check if my app's storage folder was accessed*/)){
Log.v(TAG,"Folder was accessed");
}
我應替換爲/*code to check if my app's storage folder was accessed*/
?
我不認爲有辦法做到這一點,如果通過「訪問」你的意思是「看着」。我能想到的最接近的就是'FileObserver',並且這需要你的過程持續運行,這是不切實際的並且通常是用戶敵對的。 – CommonsWare
@CommonsWare我已經更新了這個問題。你能幫忙嗎? – fosUffe