私は、規約&の条件を表示するコードを持っています。最初の行にはリンクがあります。私はそのリンクをwebviewに読み込むようにします。続きXML内のリンクはwebviewで開くべきです
は、フラグメントコード:上記のコードのリンクを使用することにより
<string-array name="tnc_text_array">
<item>Standard terms and condition apply To read click <![CDATA[<a href="example.com/termsandconditions">here</a>]]></item>
<item>lorem ipsum</item>
<item>lorem ispsum</item>
<item>lorem ipsum</item>
</string-array>
生成され、ユーザーがリンクをクリックすることができ、オープン:後
String[] tncList = getResources().getStringArray(R.array.tnc_text_array);
for(int i=0;i < tncList.length;i++)
{
LinearLayout llItem=(LinearLayout)inflater.inflate(R.layout.terms_n_cond_fragment_layout, null);
TextView txt= (TextView)llItem.findViewById(R.id.tncText);
if(i == 0) {
txt.setText(Html.fromHtml(tncList[i]));
txt.setMovementMethod(LinkMovementMethod.getInstance());
} else {
txt.setText(tncList[i]);
}
tncTextLayout.addView(llItem);
}
は、リソースファイルから文字列配列がありますブラウザで表示されますが、モバイルビューで表示されますが、デスクトップビューで開きます。
私はそれをブラウザで開くか、デスクトップビューまたはウェブビューで開きます。
利用アンドロイド:オートリンク=「すべて」のXMLのTextViewで –