Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
eddydn committed Oct 31, 2019
1 parent 41cbb81 commit 6ccbf65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions app/src/main/java/edmt/dev/afilechooser/FileListFragment.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package edmt.dev.afilechooser;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.ListView;

import androidx.annotation.NonNull;
import androidx.fragment.app.ListFragment;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
Expand Down Expand Up @@ -50,6 +52,18 @@ public static FileListFragment newInstance(String path) {
return fragment;
}

@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
Activity activity = getActivity();
try {
mListener = (Callbacks) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement FileListFragment.Callbacks");
}
}

@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
Expand Down

0 comments on commit 6ccbf65

Please sign in to comment.