how can I, character and words count from string to make a line break insert in android
I have a text output of words with max 150 letters and want the all 50 letters carried a line break without separating the word. how can I implement it? here is a code snippet ....
ll = (TableLayout) rootview.findViewById(R.id.displayLinear);
TableRow row = new TableRow(getActivity());
consoleLocalStore.storeConsoleData(consolex);
LayoutInflater inflater = getLayoutInflater(getArguments());
View theInflatedView = inflater.inflate(R.layout.activity_consolex,
null);
TextView attid = (TextView) theInflatedView.findViewById(R.id.output);
attid.setText(String.valueOf(consolex.output));
attid = new TextView(getActivity());
row.addView(attid);
row.setGravity(Gravity.CENTER_HORIZONTAL);
row.addView(theInflatedView);
ll.addView(row, i);