forked from Sketchware-Pro/Sketchware-Pro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Sketchware-Pro:main' into main
- Loading branch information
Showing
22 changed files
with
818 additions
and
528 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package <?package_name?>; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.Process; | ||
import android.util.Log; | ||
import com.google.android.material.color.DynamicColors; | ||
|
||
public class SketchApplication extends Application { | ||
|
||
private static Context mApplicationContext; | ||
|
||
public static Context getContext() { | ||
return mApplicationContext; | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
DynamicColors.applyToActivitiesIfAvailable(this); | ||
mApplicationContext = getApplicationContext(); | ||
|
||
Thread.setDefaultUncaughtExceptionHandler( | ||
new Thread.UncaughtExceptionHandler() { | ||
@Override | ||
public void uncaughtException(Thread thread, Throwable throwable) { | ||
Intent intent = new Intent(getApplicationContext(), DebugActivity.class); | ||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); | ||
intent.putExtra("error", Log.getStackTraceString(throwable)); | ||
startActivity(intent); | ||
Process.killProcess(Process.myPid()); | ||
System.exit(1); | ||
} | ||
}); | ||
super.onCreate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.