-
-
Notifications
You must be signed in to change notification settings - Fork 204
Expand file tree
/
Copy pathMainActivity.cs
More file actions
31 lines (26 loc) · 956 Bytes
/
MainActivity.cs
File metadata and controls
31 lines (26 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Android.App;
using Android.OS;
// Required for "adb shell run-as" to access the app's data directory in Release builds
[assembly: Application(Debuggable = true)]
namespace dotnet_signal;
[Activity(Name = "dotnet_signal.MainActivity", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnResume()
{
base.OnResume();
var arg = Intent?.GetStringExtra("arg");
if (!string.IsNullOrEmpty(arg))
{
var databasePath = FilesDir?.AbsolutePath + "/.sentry-native";
// Post to the message queue so the activity finishes starting
// before the crash test runs. Without this, "am start -W" may hang.
new Handler(Looper.MainLooper!).Post(() =>
{
Program.RunTest(new[] { arg }, databasePath);
FinishAndRemoveTask();
Java.Lang.JavaSystem.Exit(0);
});
}
}
}