Beispiel #1
0
        /// <summary>
        /// Use the provided <seealso cref="Looper"/> instead of the default one.
        /// </summary>
        /// <param name="looper"> The looper, must not be null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@NonNull android.os.Looper looper)
        public WeakHandler(Looper looper)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = null;
            mExec     = new ExecHandler(looper);
        }
Beispiel #2
0
        /// <summary>
        /// Use the provided <seealso cref="Looper"/> instead of the default one and take a callback
        /// interface in which to handle messages.
        /// </summary>
        /// <param name="looper"> The looper, must not be null. </param>
        /// <param name="callback"> The callback interface in which to handle messages, or null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@NonNull android.os.Looper looper, @NonNull android.os.Handler.ICallback callback)
        public WeakHandler(Looper looper, Handler.ICallback callback)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = callback;
            mExec     = new ExecHandler(looper, new WeakReference((Java.Lang.Object)callback));
        }
Beispiel #3
0
        /// <summary>
        /// Constructor associates this handler with the <seealso cref="Looper"/> for the
        /// current thread and takes a callback interface in which you can handle
        /// messages.
        ///
        /// If this thread does not have a looper, this handler won't be able to receive messages
        /// so an exception is thrown.
        /// </summary>
        /// <param name="callback"> The callback interface in which to handle messages, or null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@Nullable android.os.Handler.ICallback callback)
        public WeakHandler(Handler.ICallback callback)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = callback;                                                   // Hard referencing body

            mExec = new ExecHandler(new WeakReference((Java.Lang.Object)callback)); // Weak referencing inside ExecHandler
        }