0

I am trying to set the text when I press the save button. But when I return to the view the text is faint grey.

Initial view on Message Settings enter image description here

Updated view on Message Settings before I save enter image description here

Updated view on Message Settings after I save and return to the view. enter image description here

The source code for my SetupMessageFragment.java is here https://github.com/jackygrahamez/MayDay/blob/gradle2/app/src/main/java/com/mayday/md/fragment/SetupMessageFragment.java

There is a Log for the text retrieved from the sharedPreferences. I can see the new text vs the current textview text:

    Fragment fragment2 = getChildFragmentManager().findFragmentById(R.id.sms_message);
    ((MessageTextFragment) fragment2).setActionButtonStateListener(bAction);
    smsEditText = (EditText) fragment2.getView().findViewById(R.id.message_edit_text);
    Log.e(">>>>", "onActivityCreated smsEditText "+smsEditText.getText().toString());

    String currentMsg = SMSSettings.retrieveMessage(activity);
    Log.e(">>>>", "onActivityCreated currentMsg "+currentMsg);
    if(currentMsg != null) {
        displaySettings(currentMsg);

    }

Then the logcat

02-14 16:55:33.366  29043-29043/com.mayday.md E/>>>>﹕ onActivityCreated smsEditText I need IMMEDIATE help!
02-14 16:55:33.366  29043-29043/com.mayday.md E/>>>>﹕ onActivityCreated currentMsg I need IMMEDIATE help! Foo bar
Jack Shultz
  • 2,031
  • 2
  • 30
  • 53

2 Answers2

0

Define black color in colors.xml (<color name="black" value="#000000"/>)

Set the Edit Text color to black.

smsEditText = (EditText) fragment2.getView().findViewById(R.id.message_edit_text);
smsEditText.setTextColor(getActivity().getResource().getColor(R.color.black));
Amey Haldankar
  • 2,223
  • 1
  • 24
  • 22
0

Yo can edit the color in your colors.xml file, but as you want to use black color, which is already defined by android, you could just do this:

smsEditText = (EditText) fragment2.getView().findViewById(R.id.message_edit_text);
smsEditText.setTextColor(Color.BLACK);