How to make the Close Close window display a friendly application name instead of a package name?

I think it is possible to replace the name of the Java package in the Force Close window in Android with a more readable application name. However, I cannot find any information on how to do this, or remember where I saw it. I tried to search on Google and SO without any luck. I have tags for activity tags and applications in my manifest.

Is it possible to customize the name of the user application in the FC window, and if so, how to do it?

+2
android
source share
2 answers

There is a way to install a global exception handler that will catch any exception thrown by this thread. Thus, you establish it in your main activity, and it will be applied to each sub-activity.

But! Never do this to suppress exceptions and just show the dialog because it looks better (I would even argue that this will be the dumbest idea of โ€‹โ€‹everything you can have since you "disable the basic function that will help you fix exceptional behavior "). This is not what the handler is for! Typically, a handler calls the previous default handler to preserve the default exception handling. He only wants crash information.

I wrote this because of this answer . No offense! This is just a big fat warning to try and get the wrong behavior.

final UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread thread, Throwable ex) { // get the crash info defaultHandler.uncaughtException(thread, ex); } }); 
+2
source share

This is currently not possible without modifying the code at the system level. However, you could see that the application is an error handler. If you surround most of your application code with a large try / catch block, you can open your own dialog informing the user about the error (with the name of the application and the text of your choice, of course). However, this would have to be done for each individual event, and its much more effective practice is simply to avoid FC at all (to hire a test group?).

0
source share

All Articles