Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: App crash after Sign out and Sign in again #440

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

balaji-ramavathu
Copy link
Contributor

Fixes #437

Please Add Screenshots If any UI changes.

GIF showing that there's no crash now after sign out and sign in :

amahi-signin

Summary of changes
getContext() and getActivity() in a fragment sometimes return null. So context and activity attributes are initialized in onAttach() method of a fragment. Also, all the usages of getContext() and getActivity() in the NavigationFragment file are replaced with appropriate context and activity attributes to avoid further null exceptions.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • Run the unit tests with ./gradlew check to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

@amahi amahi deleted a comment from balaji-ramavathu Mar 18, 2019
@cpg cpg requested a review from octacode March 18, 2019 10:55
@chirag-jn chirag-jn self-assigned this Jun 18, 2020
@chirag-jn chirag-jn added the bug label Jun 18, 2020
@Akash-Ramjyothi
Copy link
Member

This crash does exist in this PR and occasionally the whole app crashes, this PR solves it up to an extent but not completely.

@chirag-jn
Copy link
Member

This indeed works fine for multiple signin and signout sessions

@chirag-jn chirag-jn added the on hold Hold on there, buddy! label Jul 6, 2020
@cpg cpg merged commit 52667ef into amahi:beta Jul 6, 2020
chirag-jn added a commit to chirag-jn/android that referenced this pull request Aug 1, 2020
commit a721c61
Author: Akash-Ramjyothi <54114888+Akash-Ramjyothi@users.noreply.github.com>
Date:   Wed Jul 29 21:22:02 2020 +0530

    Add Icons to Settings Activity (amahi#585)

    * Added Material Icons
    * Update Settings logos
    * reformat code

    Co-authored-by: Chirag Jain <jainchg@gmail.com>

commit 7eab1ea
Author: Chirag Jain <jainchg@gmail.com>
Date:   Wed Jul 29 17:07:51 2020 +0530

    Update minSDK version (amahi#583)

commit 2bd3f3b
Author: Chirag Jain <jainchg@gmail.com>
Date:   Wed Jul 29 16:40:47 2020 +0530

    gitignore (amahi#581)

commit bbcf8cf
Author: Chirag Jain <jainchg@gmail.com>
Date:   Wed Jul 29 16:40:15 2020 +0530

    update travis (amahi#578)

commit f252553
Author: Chirag Jain <jainchg@gmail.com>
Date:   Wed Jul 29 16:39:27 2020 +0530

    Add Custom Tabs to WebView (amahi#573)

    * Add Custom Tabs to WebView
    * Add License and theme to CustomTabs

commit 6d1e357
Author: Chirag Jain <jainchg@gmail.com>
Date:   Wed Jul 29 16:25:15 2020 +0530

    Add Repeat and Shuffle Feature to Music Player (amahi#576)

    * feat: music player shuffle and repeat features
    * clean code
    * enable multidex
    * Reset Exoplayer to 2.7
    * Update Multidex
    * remove multidex

    Co-authored-by: Balaji R <balajiramavathu12@gmail.com>
    Co-authored-by: Carlos Puchol <cpg+git@amahi.org>

commit f3035ff
Author: Akash-Ramjyothi <54114888+Akash-Ramjyothi@users.noreply.github.com>
Date:   Wed Jul 29 16:09:34 2020 +0530

    Added Updates to libraries (amahi#580)

    * update libvlc version
    * Added Updates to libraries
    * Update build.gradle

    Co-authored-by: Chirag Jain <jainchg@gmail.com>

commit f6f297b
Author: Akash-Ramjyothi <54114888+Akash-Ramjyothi@users.noreply.github.com>
Date:   Wed Jul 29 16:08:02 2020 +0530

    Added Last Display of Files Feature (amahi#574)

commit 761a34e
Author: Chirag Jain <jainchg@gmail.com>
Date:   Mon Jul 20 16:48:31 2020 +0530

    Application Crash Reports (amahi#565)

    * Add ACRA for Crash Reporting during development

commit f0bf41f
Author: Chirag Jain <jainchg@gmail.com>
Date:   Mon Jul 20 16:47:34 2020 +0530

    Update README with better badges (amahi#568)

    * Update README with badges

commit e7888e9
Author: Chirag Jain <jainchg@gmail.com>
Date:   Sat Jul 18 01:27:41 2020 +0530

    Add release to gitignore (amahi#562)

commit 303f0df
Author: Chirag Jain <jainchg@gmail.com>
Date:   Mon Jul 13 16:45:27 2020 +0530

    Fix App Not Loading (amahi#561)

commit adad44d
Author: Chirag Jain <jainchg@gmail.com>
Date:   Tue Jul 7 15:59:50 2020 +0530

    App Introduction Improvements (amahi#555)

    * Move to AppIntro2
    * Optimize imports

commit 99e75d9
Author: Chirag Jain <jainchg@gmail.com>
Date:   Mon Jul 6 17:07:31 2020 +0530

    Fix: Inform user if there's no internet connection while trying to access media files (amahi#553)

    * Fix: Inform user if there's no internet connection while trying to access files, also checks for local server connection
    * update strings
    * Toast -> Snackbar
    * update AppIntro

    Co-authored-by: Balaji R <balajiramavathu12@gmail.com>

commit ac2d5eb
Author: Chirag Jain <jainchg@gmail.com>
Date:   Mon Jul 6 16:55:47 2020 +0530

    Add Localization Support (amahi#545)

    * Add Locale Helper
    * Add language change preference
    * change language
    * Attach Base Context in Activities
    * remove extra dependency
    * Complete French translation
    * Add Steps to add language

commit 601914d
Author: samarth gugnani <samarth.gugnani30@gmail.com>
Date:   Mon Jul 6 16:48:11 2020 +0530

    FEAT: Music Player UI Enhanced (amahi#504)

    * Crash Solved Happening Due to lack Of Permissions and added dilogue box
    * Connection Error solved
    * fixed the connection error in apps navigation
    * Connection Error solved Final
    * UI Enhanced
    * reset new issue template
    * clean code
    * remove animatoo

    Co-authored-by: Chirag Jain <jainchg@gmail.com>

commit 57e2008
Author: samarth gugnani <samarth.gugnani30@gmail.com>
Date:   Mon Jul 6 16:45:08 2020 +0530

    Crash Solved Due to Storage and camera Permissions and Added Dialogue box  (amahi#501)

    * Crash Solved Happing Due to lack Of Permissions
    * Crash Solved Happing Due to lack Of Permissions and added dilogue box
    * Crash Solved Happening Due to lack Of Permissions and added dilogue box
    * Reset new-issue.md
    * remove extra lines
    * rearrange code in ServerFilesActivity
    * reset setupuploadfab
    * clean code
    * change strings
    * Permissions issue handled
    * refactor serverfilesactivity
    * remove extra logs

    Co-authored-by: Chirag Jain <jainchg@gmail.com>

commit 52667ef
Author: Balaji Ramavathu <balajiramavathu12@gmail.com>
Date:   Mon Jul 6 16:39:36 2020 +0530

    fix: App crash after Sign out and Sign in again (amahi#440)
@chirag-jn chirag-jn mentioned this pull request Aug 11, 2020
@chirag-jn chirag-jn linked an issue Aug 11, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug on hold Hold on there, buddy!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App Crash in settings App crash after Sign out and Sign in again
4 participants