EditText - Updating/Appending Text Problem

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

EditText - Updating/Appending Text Problem

Postby Nathan » Sat Feb 20, 2010 3:57 am

Hey, I'm recently new to Android development and am having a little trouble.

I have two Activitys, a login screen and a user home screen, now on the user home screen when I append Text nothing appears until I click on it, then my appended text would appear.

Now if the app was for me I wouldent have bothered posting, but for an end-user that sort of thing is an annoyance.

Any help would be appritiated, Iv'e only been leaning the android api for two days so bear with me.

Note: I've already tried dataText.invalidate();

Thanks.
Nathan
Freshman
Freshman
 
Posts: 3
Joined: Sat Feb 20, 2010 3:53 am

Top

Postby BLAKE.AnRKist » Sat Feb 20, 2010 11:55 am

Seeing as you have shown no snippet of the method in which you are attempting to do this, have a look at this snippet:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public class onclick extends Activity {
  3.  
  4.         String tvString = "This is some new text";
  5.  
  6.        
  7.  
  8.        
  9.  
  10.         protected void onCreate(Bundle icicle) {
  11.  
  12.              super.onCreate(icicle);
  13.  
  14.              
  15.  
  16.                  setContentView(R.layout.main);
  17.  
  18.                  
  19.  
  20.                  TextView aTV = (TextView) findViewById(R.id.aTV);
  21.  
  22.                  aTV.setText(tvString);
  23.  
  24.         }
  25.  
  26. }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


NOTE: Within my "main.xml" I have inserted a TextView with the ID of "aTV"

The string that is set in the main.xml file is just gibberish. But it changes after the "setText" is called, and the text is set according to the parameters and variables. I think you can work out the rest with the above snippet.
BLAKE.AnRKist
Junior Developer
Junior Developer
 
Posts: 11
Joined: Fri Feb 19, 2010 11:49 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 4 guests