私はAndroidを初めて使用し、配列リスト文字列の特定の文字で太字の文字を置き換えようとしています。私がしていることは:
String myName = "76492";
これは私の検索文字列であり、この文字列を配列リストで検索したいので、arraylist.Arraylist
文字列に乗るときにそれらの文字を太字にしたいのは78758,3660,56798,6514,90679です。
TextView txtf = (TextView)findViewById(R.id.textView4);
TextView txtS = (TextView) findViewById(R.id.textView5);
TextView txtT = (TextView)findViewById(R.id.textView6);
TextView txt1 = (TextView) findViewById(R.id.textView9);
TextView txt2 = (TextView) findViewById(R.id.textView13);
String str= myName.replaceAll("6", "<b>6</b>");
Spanned text = Html.fromHtml(str);
txtf.setText(text);
txtS.setText(text);
txtT.setText(text);
txt1.setText(text);
txt2.setText(text);
しかし、これはすべての文字列をマッチ文字の太字スタイルTextview
の76492文字列に置き換えます。1879検索文字列これは古い文字列を置き換えますが、このタイプを置き換えたくありません。太字の特定の位置の文字変更のみが必要です。