Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1000404 // Growing TextView test

JavaX source code (Android) - run with: the app

import android.widget.*;
import android.view.*;
import android.content.Context;
import android.app.Activity;
import java.util.Timer;
import java.util.TimerTask;

public class main {
  static String text = "";
  
  public static View main(final Activity context) {
    ScrollView sv = new ScrollView(context);
    
    final TextView tv = new TextView(context);
    tv.setText("");
    sv.addView(tv);
    
    Timer myTimer = new Timer();
    myTimer.schedule(new TimerTask() {          
      public void run() {
        context.runOnUiThread(new Runnable() {
          public void run() {
            text += "This is more text.\n";
            tv.setText(text);
          }
        });
      }
    }, 0, 1000);
    
    return sv;
  }
}

Author comment

Began life as a copy of #1000403

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, kmhbujppghqa, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
1007 #1000604 (pitcher) 2015-08-20 15:28:24
1006 #1000610 (pitcher) 2015-08-18 00:07:07
83 stefan It works!! 2015-08-03 02:58:32

add comment

Snippet ID: #1000404
Snippet name: Growing TextView test
Eternal ID of this version: #1000404/1
Text MD5: 5c382c6b49d4131ca3a4043719b62c30
Author: stefan
Category: javax android
Type: JavaX source code (Android)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-03 02:57:01
Source code size: 772 bytes / 32 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 752 / 685
Referenced in: [show references]