Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public void alertDialogWithText(){
  2. AlertDialog.Builder adb = new AlertDialog.Builder(new ContextThemeWrapper(MainActivity.this, R.style.EditTextAlertDialog));
  3. adb.setTitle("Title");
  4. inputET = new EditText(this);
  5. inputET.setInputType(InputType.TYPE_CLASS_TEXT);
  6. inputET.setTextColor(getResources().getColor(android.R.color.white));
  7. adb.setView(inputET);
  8.  
  9. adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  10. @Override
  11. public void onClick(DialogInterface dialog, int which) {
  12.  
  13. }
  14. });
  15.  
  16. adb.show();
  17. }
  18.  
  19. <?xml version="1.0" encoding="utf-8"?>
  20. <resources>
  21. <color name="colorPrimary">#303030</color>
  22. <color name="colorPrimaryDark">#000</color>
  23. <color name="colorAccent">#fff</color>
  24. </resources>
  25.  
  26. <style name="EditTextAlertDialog">
  27. <item name="android:textColor">@android:color/white</item>
  28. <item name="android:background">#444</item>
  29. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement