Search Results

Search found 1 results on 1 pages for 'user369150'.

Page 1/1 | 1 

  • Java - Set Color by switch case function

    - by user369150
    I want to set the color of the TextView by the function getcolorss. I tried a lot of different ways but i cant get in it. Please help me i think the solution is easy. import java.awt.*; import android.graphics.Color; public class test extends Activity { TextView text1 = (TextView) findViewById(R.id.text1); text1.setTextColor(getcolorss(1)); public Color getcolorss(int x) { switch(x) { case 1: return Color.BLUE; case 2: return Color.RED; } } }

    Read the article

1