Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Fragment not attached to activity  #823

Description

@lalith-b

When using @Background annotations on @EFragment there is all chances that the fragment may not be attached to the activity while calling @UiThread annotated method from a background thread. In the case of @EFragment it is required to do a getActivity()!=null check to avoid IllegalStateException as fragment not attached to Activity

Can this be done as a conditional check for @EFragments alone ?

Activity

  1. WonderCsabo commented on Dec 28, 2013

    @WonderCsabo
    Member

    I am not an AA developer, but i do not think this should be handled by the AA generated classes at all. There are very different scenarios and very different solutions for them, let the programmer resolve these. For example in a lot cases a simple null check is not enough if we really have to do this operation. By the way, the Android framework does not check this, too: if you are using an AsyncTask, it will also crash with IllegalStateException.

  2. DayS commented on Dec 28, 2013

    @DayS
    Contributor

    I totally agree with @WonderCsabo. I can't and we shouldn't handle this kind of use cases. If you really want to have a framework dealing with this you can take a look at the great RoboSpice project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions