Hiding edit text in onCreate, but then not storing values once values entered for EditText, clipEx has text data false
<p>The app crashes when the button is selected which uses the values converted from edit texts. Tried multiple ways to move the part edittext = R.ids .. to try and make sure the edittexts picks new values after the oncreate first runs. </p>

<p>Think the calculation part causes the crash because its trying to perform a calculation with stored values from the edit text when the value is false from the first time the edit text gets the R.ids... in the onCreate method. </p>

<p>needed hide/display editText based off a radio button setonCheckedChangeListener in the onCreate method. So edittext = R.ids .. set in this method, the app does not crash at runtime like it would if I moved the edittext = R.ids .. to the testFunction method.  </p>

<pre><code>EditText editTextValue;
EditText editTextValue2;
double amount; 
protected void onCreate(){...
//Get edittext field parameters
 editTextValue = (EditText) findViewById(R.id.editText_weight_kg);

 //listener to switch editTexts on which radio button selected in units group
   unitsRG.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
             if (checkedId == R.id.imperial) {
                editTextValue2.setVisibility(View.VISIBLE);
                editTextValue.setVisibility(View.GONE);
    }

 void testFunction(View view){
     String stringValue = editTextValue..getText().toString();

    //check value as long as its not empty for the edit text , save it 

    if (editTextValue.getText().length() &gt; 0) {
        amount = Integer.parseInt(stringValue);
        Log.e("MainActivity", " " + amount);
    }

}
</code></pre>

<p>but now when I run the app I get this error in the long cat 
<a href="https://i.stack.imgur.com/FmHZB.png" rel="nofollow noreferrer">enter image description here</a></p>

<pre><code>E/ClipboardServiceEx﹕ clipEx is android.sec.clipboard.ClipboardExManager@1f70b420
E/ClipboardServiceEx﹕ clipEx has text data : false
</code></pre>

<p>here is the xml for one of the edit texts </p>

<pre><code>&lt;EditText
         android:id="@+id/editText_weight_lb"
         style="@style/EditTextViewStyle"
         android:visibility="visible"/&gt;
</code></pre>

<p>In the editTextStyle , I set the textCursorDrawable to null to try and have different colors for the pointer and underline colors. Not sure if this could also be affecting the editTextView storing the value </p>

<pre><code>&lt;item name="android:textCursorDrawable"&gt;@null&lt;/item&gt;
</code></pre>

<p>I also tried setting edittext = R.ids in the testfunction and in the onCreate method. See if the editTexts would store the values the user enters rather than keeping the empty values when onCreate initially run. </p>

<p>I still got the same clipEx has text data:false error after trying this.</p>

<p>I searched the logcat error "clipEx has text data: false" and found something regarding samsung memory leaks. 
<a href="https://github.com/square/leakcanary/issues/133" rel="nofollow noreferrer">https://github.com/square/leakcanary/issues/133</a> 
I am using a samsung galaxy for testing. I feel the issue is more with where I'm setting the edittexts to the R.ids thats causing the issue. </p>

<p>I saw the post for checking to make sure valid value entered for edittext. 
<a href="https://stackoverflow.com/questions/11383755/issue-with-empty-edittext">Issue with empty EditText</a>
<a href="https://stackoverflow.com/questions/28584033/how-to-check-whether-a-value-is-entered-in-editexts-before-submitting">How to Check whether a value is entered in editexts before submitting?</a>
will add the check after finding out why values are not getting stored/ still remaining false. 
Thanks</p>