public class MainActivity extends AppCompatActivity
{
// Global variable
private Button clickButton;
private final Intent chooserIntent = new Intent(this, DirectoryChooserActivity.class);
private static final String TAG = "MainActivity";
private final DirectoryChooserConfig config = DirectoryChooserConfig.builder()
.newDirectoryName("DirChooserSample")
.allowReadOnlyDirectory(true)
.allowNewDirectoryNameModification(true)
.build();
I've tried everything and still get an error. It is an emergency; I have to finish this thing in two days. Help me, please.
== Manifest == <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
== build.gradle == plugins { id 'com.android.application' }
android { namespace 'com.example.retrychoosedirectory' compileSdk 32
}
dependencies {
}
== Main Activity == package com.example.retrychoosedirectory;
import androidx.activity.result.ActivityResult; import androidx.activity.result.ActivityResultCallback; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast;
import net.rdrei.android.dirchooser.DirectoryChooserActivity; import net.rdrei.android.dirchooser.DirectoryChooserConfig;
public class MainActivity extends AppCompatActivity { // Global variable private Button clickButton; private final Intent chooserIntent = new Intent(this, DirectoryChooserActivity.class); private static final String TAG = "MainActivity"; private final DirectoryChooserConfig config = DirectoryChooserConfig.builder() .newDirectoryName("DirChooserSample") .allowReadOnlyDirectory(true) .allowNewDirectoryNameModification(true) .build();
}