Ejemplo n.º 1
0
            public void OnAppNotResponding(ANRError error)
            {
                Log.Error("ANR-Watchdog-Demo", "Detected Application Not Responding!");

                // Test serialization
                try
                {
                    IFormatter serializeFormatter = new BinaryFormatter();
                    using (var stream = new MemoryStream())
                    {
                        // Serialize
                        serializeFormatter.Serialize(stream, error);

                        // Deserialize
                        IFormatter deserializeFormatter = new BinaryFormatter();
                        stream.Position = 0;
                        var deserializedError = (ANRError)deserializeFormatter.Deserialize(stream);
                        Log.Error("ANR-Watchdog-Demo", error, "Original ANR");
                        Log.Error("ANR-Watchdog-Demo", deserializedError, "Deserialized ANR");
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                Log.Info("ANR-Watchdog-Demo", "Error was successfully serialized");

                throw error;
            }
Ejemplo n.º 2
0
 public void OnAppNotResponding(ANRError error) =>
 Log.Error("ANR-Watchdog-Demo", error, "ANR");