1
Java에서 FileIndexer 클래스를 작성했으며이를 Android 앱에 가져 오려고합니다. 그러나, 나는 다음과 같은 오류가 ... 여기 사용자 정의 클래스를 Android 프로젝트로 가져올 때 생성자가 표시되지 않습니다.
The constructor FileIndexer(File) is not visible
내가 인스턴스화하려고 곳이다 :
import mpss.categorizer.FileIndexer;
...
try {
FileIndexer indexer = new FileIndexer(getExternalFilesDir(null));
} catch (Exception e) {
Log.w("Indexing", "Error creating FileIndexer: " + e.getMessage());
}
을 그리고 여기 FileIndexer 내부의 생성자 :
public class FileIndexer {
private FSDirectory fsDirectory;
private ArrayList<File> queue;
public FileIndexer(File f){
try {
fsDirectory = FSDirectory.open(f);
} catch (IOException e) {
System.out.println("Invalid location: " + e.getMessage());
}
}
내가 만든 jar 파일 인 다음, 그것을 안드로이드 빌드 경로에 추가했습니다. 또한 내 매니페스트에는 다음이 포함됩니다.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
외부 저장소에 액세스 할 수있는 권한이 아닙니다. 왜 내가이 오류가 발생하는지 어떤 생각?
이것은 컴파일 타임 오류입니다. 맞습니까? 올바른 FileIndexer를 가져 왔습니까? FileIndexer의 다른 생성자는 무엇입니까? – cklab