You need something to replace it.
Imagine you went to a restaurant. And they had three things to eat: good but unhealthy food, healthy shit and healthy piss. You would pick that tasty food everytime, wouldn't you? But if you were offered to choose from "good food, good food2, good food3" you'd most likely change whether you take good food1 or 2 or 3.
So long as using the phone or laptop is the most enjoyable thing for you to do, you will continue to do it. Your brain will choose "enjoyable" over "healthy" or "enjoyable in the future".
Phones and laptops are excellent, they help you forget your shitty life, your shitty environment, and they can offer so much for you. You want a dog but can't get one? Just play a dog sim or watch videos of dogs. You want to travel to India but can't? Just watch videos of India. Lonely? Post on forums/reddit/twitter/youtube/twitch etc.
One thing you could do is buy an Oculus. That way you'd still be playing video games or surfing on the internet or watching videos/movies/youtube, but at least you'd most likely do it while standing and thus get exercise. You could also play exercise games, I used to love playing boxing games and so I could combine playing a video game and getting a good workout. Also, you most likely couldn't be able to keep it on your head for longer than an hour or two per session (and it would run out of charge anyway) so would get breaks that way.
Or just make a habit of doing one thing for even a few minutes every day. Something like "Every time I make one post on SS, I rise up, do 10 burpees/leglifts/stretches or walk around the house/apartment". It might seem small, but small things make big things. It will take about 3 weeks but then it will become an enjoyable hobby.
I used to run for a hobby. It was hard at first, but then I just couldn't go a day without running. It takes time for things to start feeling nice.
And if nothing else helps, one thing that helps me everytime, is asking other users to kick my ass. One time I had to clean, so I asked other members to tell me to clean, and iirc, three different people told me to stop being a lazyass and go clean, and I just automatically went and cleant lol. Same with exercise, I told someone I did 10 lifts (can't remember the English name) and they told me I can do better and I felt embarrassed and went and did 10 more lol.
I'll actually follow my own advice for once and go exercise for 5 minutes. I should get stronger sides and stomach.
EDIT: Oh and get sports tracker on your phone. I was really proud of myself when I managed to stand for 1 hour a few days ago using sports tracker and seeing the calories burn and I thought I wouldn't sit down until it had been one hour.