Updating TextView from one class to another

by Silvara » Sat, 21 Feb 2009 01:49:29 GMT

Sponsored Links
 Hi All;

I have a TextView which i want to set its text from another class ..
But it is not working ..

My code is as belows

public  class callscreen extends Activity implements
        public static final TextView callStatus = null;
           public void onCreate(Bundle savedInstanceState) {
final TextView callStatus = (TextView) findViewById(R.id.callStatus);


//this is the class where i want to update callStatus value

public void onCallRinging(Call call, Message resp) {
                printLog("onCallRinging()", LogLevel.LOW);
                if (call != this.call && call != call_transfer)
                        printLog("NOT the current call", LogLevel.LOW);
                printLog("RINGING", LogLevel.HIGH);

                // play "on" sound
                //if (clip_on != null)
                if (listener != null)

Do you have any idea why am i not able to do this?


Other Threads

1. How to change font type say "Arial" of a TextView via xml layout properties...

> I been trying to figure out how to change the font type of a TextView

Via XML, you can only specify the three built-in font types (sans, serif,

For anything else, you need to use Typeface.createFromAsset() (for
TrueType fonts stored as assets) and apply it in Java code.

Mark Murphy (a Commons Guy)
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!


2. how to create dynamic views


i am creating one quiz application, for question page i have created
one view by using Linear layout in that i have added four TextAreas,
first TextArea for question and reaming three are for answer cell. so
now, when user select the answer cell i want to show next question
screen for that i am thinking of creating new view. means some
questions may have two answers so  i want to create that run time.

how to create new view at run time and how to switch for new view.


3. webview to show large picture zoomed out

4. a Dialog Problem..

5. Can't catch SQLiteConstraintException

6. Transparency on Views behaving differently in 1.5

7. MmsApp giving a ClassNotFoundException and resulting in incoming text messages being lost.