9. Android dialog oynasi
Download 328.36 Kb. Pdf ko'rish
|
1 2
Bog'liq1-9
showDialog() и в
обработчике события onCreateDialog() в операторе switch: protected Dialog onCreateDialog(int id) { Dialog dialog; switch(id) { case DIALOG_PAUSED_ID: // Код для работы с диалогом Пауза break; case DIALOG_GAMEOVER_ID: // Код для работы с диалогом Игра окончена break; default: dialog = null; } return dialog; } Activity.onCreateDialog() va Activity.onPrepareDialog() usullari eskirganligini unutmang. DialogFragment-dan foydalaning. AlertDialog dialog oynasi AlertDialog tipidagi dialog oynalarini yaratish misollari ushbu maqolada muhokama qilinadi. Havola bilan AlertDialog 5 Ehtimol, bu amaliy ma'noga ega emas, lekin siz xabar matnini havola qilishingiz mumkin. private void openSiteDialog() { final SpannableString webaddress = new SpannableString( "http://developer.alexanderklimov.ru/android/"); Linkify.addLinks(webaddress, Linkify.ALL); final AlertDialog aboutDialog = new AlertDialog.Builder( TestActivity.this).setMessage(webaddress) .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }).create(); aboutDialog.show(); ((TextView) aboutDialog.findViewById(android.R.id.message)) .setMovementMethod(LinkMovementMethod.getInstance()); Download 328.36 Kb. Do'stlaringiz bilan baham: |
1 2
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling