-
Notifications
You must be signed in to change notification settings - Fork 5
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 connectivity android #568
base: project/PH1
Are you sure you want to change the base?
Conversation
/// <param name="disposing"><c>true</c> to dispose managed state.</param> | ||
/// <seealso cref="Dispose"/> | ||
/// <seealso cref="T:System.IDisposable"/> | ||
protected virtual void Dispose(bool disposing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add additional public method:
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
to be able to remove observer from outside
{ | ||
Connectivity.ConnectivityChanged -= CurrentConnectivityChanged; | ||
Connectivity.ConnectivityChanged += CurrentConnectivityChanged; | ||
CurrentConnectivityChanged(this, new ConnectivityChangedEventArgs(Connectivity.NetworkAccess, Connectivity.ConnectionProfiles)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary to manually trigger an event only on Start at this place?
/// </param> | ||
public DroidConnectivityService(IConnectivity connectivity) : base(connectivity) | ||
{ | ||
_startAction = new WeakAction(OnAppStart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need Lifecycle.Event.ON_CREATE
or ON_RESUME
also?
@@ -18,4 +18,8 @@ | |||
<ProjectReference Include="..\Softeq.XToolkit.Common\Softeq.XToolkit.Common.csproj" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Process" Version="2.6.2.1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason for Common
projects is 'no 3rd-party dependencies'
Description
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
PR Checklist