AmazeFileManager icon indicating copy to clipboard operation
AmazeFileManager copied to clipboard

`java.lang.IllegalStateException: TabFragment not attached to an activity` on `TabFragment#requireMainActivity`

Open XYIheng opened this issue 3 years ago • 4 comments

Describe the bug I used to use Amaze 3.5.3, However, after install the newest version 3.7.2, I find a crash which annoys me a lot.

After installation, rotate the device and accept storage permission, then Amaze crashes. However, it behaves normally on Amaze 3.5.3

To Reproduce Steps to reproduce the behavior:

  1. install Amaze 3.7.2
  2. open Amze
  3. rotate device
  4. click "Allow Amaze to access photos,media, and files on your divice"
  5. see crash report

Expected behavior I can still see my files and use AmazeFileManager normally

Screenshots

https://user-images.githubusercontent.com/31406320/176077657-7d361c4b-3b30-47c1-aef9-13a55b3ace4b.mp4

Smartphone (please complete the following information):

  • Device: [e.g. Google Pixel 2]
  • OS: [e.g. Android 9]
  • Rooted: [e.g. No]
  • Version: [e.g. 3.3.4]

Additional context

Issue explanation (write below this line)

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.7.2
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 8.0.0 - 26
  • Device: generic_x86
  • Model: Android SDK built for x86
  • Product: sdk_gphone_x86
Crash log

java.lang.IllegalStateException: Fragment TabFragment{482657d} (0ab7c6c7-267f-4f7c-98ff-4de39ef40029) not attached to an activity.
	at androidx.fragment.app.Fragment.requireActivity(Fragment.java:928)
	at com.amaze.filemanager.ui.fragments.TabFragment.requireMainActivity(TabFragment.java:497)
	at com.amaze.filemanager.ui.fragments.TabFragment.refactorDrawerStorages(TabFragment.java:346)
	at com.amaze.filemanager.ui.activities.MainActivity.lambda$onPermissionGranted$1(MainActivity.java:512)
	at com.amaze.filemanager.ui.activities.MainActivity.$r8$lambda$p7zQEtaqRSrFGunP-GdzA6cGHkk(Unknown Source:0)
	at com.amaze.filemanager.ui.activities.MainActivity$$ExternalSyntheticLambda17.run(Unknown Source:6)
	at io.reactivex.internal.observers.CallbackCompletableObserver.onComplete(CallbackCompletableObserver.java:53)
	at io.reactivex.internal.operators.completable.CompletableObserveOn$ObserveOnCompletableObserver.run(CompletableObserveOn.java:89)
	at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
	at android.os.Handler.handleCallback(Handler.java:789)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6541)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)


XYIheng avatar Jun 28 '22 02:06 XYIheng

I have encountered the same issue.

tingsu avatar Jun 29 '22 00:06 tingsu