/// <summary>Construct an empty Toast object.</summary> /// <remarks> /// Construct an empty Toast object. You must call /// <see cref="setView(android.view.View)">setView(android.view.View)</see> /// before you /// can call /// <see cref="show()">show()</see> /// . /// </remarks> /// <param name="context"> /// The context to use. Usually your /// <see cref="android.app.Application">android.app.Application</see> /// or /// <see cref="android.app.Activity">android.app.Activity</see> /// object. /// </param> public Toast(android.content.Context context) { mContext = context; mTN = new android.widget.Toast.TN(); mTN.mY = context.getResources().getDimensionPixelSize([email protected]_y_offset ); }
/// <summary>Show the view for the specified duration.</summary> /// <remarks>Show the view for the specified duration.</remarks> public virtual void show() { if (mNextView == null) { throw new java.lang.RuntimeException("setView must have been called"); } android.app.INotificationManager service = getService(); string pkg = mContext.getPackageName(); android.widget.Toast.TN tn = mTN; tn.mNextView = mNextView; try { service.enqueueToast(pkg, tn, mDuration); } catch (android.os.RemoteException) { } }