Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81d5dad1 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge "Adding a stopLoading() method."

parents 533ca7b8 d92ea071
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -27930,6 +27930,19 @@
<parameter name="args" type="android.os.Bundle">
</parameter>
</method>
<method name="stopLoading"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="id" type="int">
</parameter>
</method>
</class>
<class name="LocalActivityManager"
 extends="java.lang.Object"
+17 −1
Original line number Diff line number Diff line
@@ -174,6 +174,22 @@ public abstract class LoaderManagingFragment<D> extends Fragment
        }
    }

    /**
     * Stops and removes the loader with the given ID.
     */
    public void stopLoading(int id) {
        if (mLoaders != null) {
            LoaderInfo<D> info = mLoaders.remove(id);
            if (info != null) {
                Loader<D> loader = info.loader;
                if (loader != null) {
                    loader.unregisterListener(this);
                    loader.destroy();
                }
            }
        }
    }

    /**
     * @return the Loader with the given id or null if no matching Loader
     * is found.