NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
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
private void carregarFilmes() { | |
Context context = MainActivity.this; | |
//Se há conexão disponível | |
if (NetworkUtil.isNetworkConnected(context)) { | |
//Aqui fazemos a chamada ao servico responsavel por carregar os filmes de acordo com as preferencias do usuario | |
} else { | |
//Se não há conexão disponível, exibe a mensagem | |
View view = getActivity().findViewById(R.id.activity_main); | |
Snackbar snackbar = Snackbar.make(view, getString(R.string.no_internet_connection), Snackbar.LENGTH_LONG); |