Created
January 22, 2012 03:01
-
-
Save aztack/1655223 to your computer and use it in GitHub Desktop.
set/get text of TextView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.Android.HelloAndroid; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.KeyEvent; | |
import android.view.MotionEvent; | |
import android.widget.TextView; | |
public class TextViewDemo extends Activity | |
{ | |
private static final String TAG = "HelloAndroid"; | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
TextView desc = (TextView)findViewById(R.id.description); | |
Log.d(TAG,desc.getText().toString()); | |
desc.setText("Hello Android!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment