title: how to change the color of "Textview" when i Click the "Toggle Button" in programmatically in Android Studio?
body: <pre><code>tg.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              if (tg.equals("ON")) tv.setTextColor(Color.parseColor("#3F51B5"));
              else tv.setTextColor(Color.parseColor("#E0E0E0"));
  
  
  
          }
      });
  </code></pre>
  
  <p>"here tg means toggle button object and tv means Textview object"</p>