Wednesday, November 30, 2022

The memories we inform ourselves

 by using sharon salzberg


photograph courtesy of unsplash

we tell ourselves tales with a purpose to live. — joan didion


our minds are stressed to create order, a cohesive narrative, and our tales are our anchors. They inform us who we are, what subjects most, what we’re able to, what our lives are all approximately. Some thing occurs to us in youth — say, a canine bites us — and all at once we've a tale. We end up frightened of all puppies, and for years in a while, we destroy into a sweat each time a dog comes close. If we pay interest, sooner or later we recognise we’ve spun a story in our minds about an entire species primarily based on a single incident with a single animal — and that our tale isn't without a doubt authentic. The stories we tell ourselves are the critical topics in our psyches. If we’re the kid of an emotionally needy, alcoholic figure, we would finish — unconsciously — that it’s our activity to take care of definitely everyone, even to our very own detriment. If as adults we’re recognized with a serious illness, we can also trust it’s our fault and create a story around that: we didn’t eat proper.


We stayed too long in a poisonous relationship. Till we start to question our simple assumptions about ourselves and consider them as fluid, now not fixed, it’s clean to repeat hooked up styles and, out of addiction, reenact antique stories that limit our capability to stay and love ourselves with an open coronary heart. Thankfully, as soon as we ask whether or not or not a story is true within the gift second, we empower ourselves to reframe it. We begin to notice that nearly all of our stories may be cast in numerous lights, relying on our factor of view. Every now and then we may be the hero of our story; at other times, the victim. I consider jonah, who was the primary in his family to wait college. Even the first step of making use of turned into daunting, and as soon as he became admitted, he had to discover a way to finance his schooling himself. That meant juggling lengthy shifts at paintings and a heavy route load at school. He struggled to preserve up in his classes. Still, as he proudly tells his story, the boundaries he overcame were a key to his success. Jonah graduated and were given a very good process, in which he met his companion. A decade after graduation, jonah says, “look at me now.”


however jonah might tell his tale in a exclusive manner, with ache taking a more significant position. There would be extra memories of lonely nights, feelings of exclusion, concerns approximately being an impostor. Jonah might describe how the sector was stacked against him and linger over the individuals who had slighted him. It'd still be a hero’s story, however one marked via frustration and bitterness. The various tales we tell ourselves approximately love are like the painful version of jonah’s tale. We’re greater inclined to treat beyond losses with self-blame than with compassion. And when it comes to the present, we have a tendency to invest and fill within the blanks: a chum doesn’t name at the appointed hour and we’re satisfied he’s forgotten us, when in reality he needed to take his unwell baby to the health practitioner.


 Our boss asks to speak to us and we’re satisfied we’ve achieved something incorrect, whilst alternatively we’re given a brand new assignment. Due to the fact we’re now not conscious that we’re spinning a story, those narratives can contribute to anxiety and despair, whilst constricting our hope for the future and ingesting away at our self confidence. Certainly one of my college students attributes his painful marriage and divorce, in addition to different “failed” relationships, to his personal emotions of unworthiness and self-blame. “i am so skinny-skinned due to the fact i’m beating myself up 24–7,” he says. “had i been more compassionate with myself in my past relationships, possibly i would’ve had higher coping mechanisms.” via psychotherapy and meditation, this student has learned to question his negative storytelling and song out the regular chatter of his internal critic. Diane, whose associate had currently broken off their engagement, without delay blamed herself for being “unlovable,” despite the fact that she, too, harbored severe doubts approximately the future of the relationship. However as opposed to pausing and investigating the supply of her story of unlovability with mindfulness and self-compassion, diane leaped to a poor conclusion carried over from early life. If we heard a pal say, “i’m now not worth a great deal. I’m now not interesting, i’ve failed at a lot, and that’s why nobody loves me,” we'd possibly bounce to her protection. “but i really like you,” we’d insist. “your other friends love you, too. You’re an amazing person.” but so frequently we don’t counter the bad statements that crowd our own minds every day. Rather, we'd ask ourselves: if i take a look at what’s happening through the eyes of love, how might i tell this story?

Monday, October 17, 2022

How To Replace The Standard Crash Dialog With A Custom Error Screen? (Android)

 I've switched all of this over completely to single reliance look at the Venture's Github Page


Mistakes… Our applications sometimes crash for purposes we never expected, in spite of the precautionary measures we take against every one of them. Anyway, rather than continuously showing the client with this exhausting accident exchange during the blunder, couldn't it be superb in the event that we showed our own accident screen?


What we will do is straightforward. First we will make ourselves an Accident Movement and Application Class. Then, with a solitary line that we will add to the Application Class, we will begin our own Accident Action at whatever point our application crashes.


So.. We should begin from the hardest part. We should make ourselves a class named

GlobalExceptionHandler and it will require three fundamental boundaries. Likewise it must be stretched out by Thread.UncaughtExceptionHandler class


The main gander at our group

We will begin the activityToBeLaunched at whatever point our application crashes however we need to change the Expectation a tad to send off our movement so lets make a confidential capability named launchActivity


The Confidential Capability

How about we head back to uncaughtException technique and call our new strategy


Last look of the uncaughtException technique

defaultHandler.uncaughtException(p0, p1) capability's called at whatever point any sort of exemption happens while beginning the Movement. In this present circumstance default blunder exchange will appear rather than activityToBeLaunch


Gson Reliance

We want it to ease up our work. Add the line beneath to your build.gradle(App) record


implementation("com.google.code.gson:gson:2.9.1")

Last step is making a buddy object and making two additional strategies inside.


Friend object of GlobalExceptionHandler

initalize: Most significant capability. It must be run at OnCreate capability at Application class. It will supplant the default ExceptionHandler to our group.


getThrowableFromIntent: It'll retrive Throwable information from the action we will utilize.


Crash Action

We should proceed to our work by making our Action that will show after our application crashes.


Choices under the new menu


Pronouncing name for the Accident Screen

We made our Accident Movement. Presently we should make the plan.


See of Crash Action

You can look at project with all items inside from here


Our plan is finished. Following stage is giving a few activities to these buttons. How about we give them…


We gave the activities to the buttons and last significant thing we will do is seprating the Principal Application process with the Accident Movement by adding single line to show. So at whatever point our application's cycle is crashed the Accident Action will be not contaminated by that blunder


Test Movement

Subsequent to finishing our blunder movement, we should make an action that has just a straightforward plan and will just objective the application to crash. I will alter the Fundamental Action we as of now have.


As a matter of some importance, I will involve a basic TextView and Button as a plan.


The see of Primary Action

In the code part, I will toss a blunder when the button is squeezed.


MainActivity.kt

Making the Application class

In the event that you don't have an application class at your venture. Open your AndroidManifest record and get within Application tag and add the android:name line to your document


It's showing Application name as red true to form.


Click the bulb and select Make class 'Application'


We should call our GlobalExceptionHandler.initalize strategy

Everything is finished!

How about we send off our application and see the outcomes.


With GlobalExceptionHandler/Without GlobalExceptionHandler

Our GlobalExceptionHandler class is functioning true to form! You can likewise see the Throwable information at logs.

The memories we inform ourselves

  by using sharon salzberg photograph courtesy of unsplash we tell ourselves tales with a purpose to live. — joan didion our minds are stres...