Sitemap
CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Mastering Android Dialogs: Don’t follow official Google Guides

12 min readNov 6, 2022

--

Press enter or click to view image in full size
Photo by Randy Laybourne on Unsplash

This article is part of a multi-series on Mastering Android Dialogs

  1. Don’t follow official Google Guides
  2. Using Coroutines to show and get results from Dialogs easily
    COMING SOON

Intro

Callbacks, listeners, onActivityResults — these are spread all over Android APIs, and frankly speaking, it drives me crazy. Every time you want to ask for permission, take a picture, choose a file, or even show a simple dialog you have to deal with them. After some time I feel more like playing ping-pong in Android than actually writing readable, maintainable, and, what’s very important, REUSABLE code.

Do we have to use them? Is there a better way? Of course, there are lots of better ways and countless solutions to the same problem — as usual in Android. This article explains why Google Guides for Dialogs are bad and what risks you and your apps may face if you follow them.

What is currently recommended by Google?

Let’s look into the official documentation as of November 2022 and check out what Google recommends when dealing with dialogs. The most common places to find information about it are the guides below.

--

--

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Patryk Kosieradzki
Patryk Kosieradzki

Written by Patryk Kosieradzki

Senior Android &iOS Engineer @ Moss, based in Warsaw, Poland

Responses (3)