Tag Archives: textview

1,799 views

Linkify TextView clickable phone number url adress

android:autoLink=”all” <!– text1 automatically linkifies things like URLs and phone numbers. –> <TextView android:id="@+id/text1" android:layout_width="match_parent" android:layout_height="match_parent" android:autoLink="all" android:text="@string/link_text_auto" />

Posted in Android Examples Code | Tagged , | Comments Off on Linkify TextView clickable phone number url adress
5,220 views

Font Family change on View dynamically Android Example

TypeFace, setTypeface, font, font family, array of String, Button create dynamically @Override protected void onStart() { LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( 48, 55 ); Typeface typeFace = Typeface.MONOSPACE; String [] ar = {"A","B","C","D","E","F","G","H","J","K"}; for (int i = 0; i < … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Font Family change on View dynamically Android Example
12,570 views

Append text and ad text to TextView Android example

String s = "Some text for appending\n"; TextView mTitle = (TextView) findViewById(R.id.title_text); mTitle.setText(R.string.app_name); // insert text from strings.xml mTitle.append(s); // append string like a variable value mTitle.append("My string will appended\n"); // append string You can insert this source code into … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Append text and ad text to TextView Android example
69,064 views

Linkify text link url in TextView text Android example

Example from SDK C:\Program Files\Android\android-sdk-windows\samples\android-10\ApiDemos\src\com\example\android\apis\text\Link.java Source: http://developer.android.com/resources/browser.html?tag=sample License: http://www.apache.org/licenses/LICENSE-2.0 1.) Automatically linkifies using android:autoLink=”all” // res/values/strings.xml <string name="link_text_auto"><b>text1:</b> This is some text. In this text are some things that are actionable. For instance, you can click on http://www.google.com and it … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Linkify text link url in TextView text Android example
7,267 views

Html List tag in Android TextView – Android sample

Html.fromHtml(String) does not support all HTML tags. For example < ul > and < li > are not supported. Try this source code as a substitute for HTML List Tags. String str = "&bull; Cessnock<br />" +"&bull; Dubbo<br />" +"&bull; … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Html List tag in Android TextView – Android sample
3,441 views

How set text to TextView as HTM HTML format Android example

Html.fromHtml(), setText(), textView.setText(Html.fromHtml(String htmlFormat)), Android example. TextView mIdTextOk = (TextView)findViewById(R.id.idTextOk); int _nOk = 57; // number 57 will bold style mIdTextOk.setText(Html.fromHtml( "OK: "+"<b>"+_nOk+"</b>"));

Posted in Android Examples Code | Tagged , , | Comments Off on How set text to TextView as HTM HTML format Android example
46,938 views

How update View TextView with timer Android runnable example

Update TextView by runnable. Handler, runnable, timer Android example. public class TimerActivity extends Activity { TextView hTextView; Button hButton, hButtonStop; private Handler mHandler = new Handler(); private int nCounter = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); hTextView … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on How update View TextView with timer Android runnable example
13,294 views

Adding TableRow add row with a View TextView dynamically to TableLayout Android sample example

Adding TableRow with a View TextView (EditText Button) programmically dynamically to TableLayout Android sample basic example. MainClass.java public class MainClass extends Activity {   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);   TableLayout tl = (TableLayout)findViewById(R.id.tableLayout1); TableRow row = … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Adding TableRow add row with a View TextView dynamically to TableLayout Android sample example
9,941 views

Create TextView dynamically Android sample

Example source code for Android Developers // clickable TextView public TextView createTextView(String sText, Context con){ TextView b = null; try { b = new TextView (con); b.setTextSize(15.0f); b.setTextColor(Color.rgb( 0, 0, 200)); b.setOnClickListener(this); b.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); b.setText(sText); //tr.addView(b, 60,30); } catch … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Create TextView dynamically Android sample