Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void alertDialogWithText(){
- AlertDialog.Builder adb = new AlertDialog.Builder(new ContextThemeWrapper(MainActivity.this, R.style.EditTextAlertDialog));
- adb.setTitle("Title");
- inputET = new EditText(this);
- inputET.setInputType(InputType.TYPE_CLASS_TEXT);
- inputET.setTextColor(getResources().getColor(android.R.color.white));
- adb.setView(inputET);
- adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- }
- });
- adb.show();
- }
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <color name="colorPrimary">#303030</color>
- <color name="colorPrimaryDark">#000</color>
- <color name="colorAccent">#fff</color>
- </resources>
- <style name="EditTextAlertDialog">
- <item name="android:textColor">@android:color/white</item>
- <item name="android:background">#444</item>
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement