Im creating a app that takes in a string and divides it into words and reprints them while checking if there is a '#' in front of the words. If there is a '#' the color of that word is changed. The problem i am having is the String gets cut if the original String is too long. any help?
public class MainActivity extends Activity {
String[] parts;
LinearLayout.LayoutParams layoutParams ;
int size;
LinearLayout L;
String s ="This is the test String that is divided #Testing ";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
L=(LinearLayout)findViewById(R.id.ll);
layoutParams= new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
parts = s.split(" ");
size = parts.length;
for(int i=0; i<size;i++)
{
TextView valueTV = new TextView(this);
String d= parts[i] + " ";
valueTV.setText(d);
// valueTV.setLayoutParams(layoutParams);
if(d.charAt(0)=='#')
{
valueTV.setTextColor(Color.CYAN);
}
L.addView(valueTV,layoutParams);
}
}
}