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

37
LINES

< > BotCompany Repo | #1000337 // Dummy default code for JavaX/Android 2 (toast only)

JavaX source code - run with: x30.jar

import android.view.*;
import android.widget.*;
import android.content.Context;

public class main {
  public static View main(final Context context) {
    ScrollView sv = new ScrollView(context);
    LinearLayout ll = new LinearLayout(context);
    ll.setOrientation(LinearLayout.VERTICAL);
    
    LinearLayout line1 = new LinearLayout(context);
    
    TextView label = new TextView(context);
    label.setText("Run which snippet ID?");
    line1.addView(label);
    
    final EditText tv = new EditText(context);
    tv.setText("675");
    line1.addView(tv);
    
    Button btnGo = new Button(context);
    btnGo.setText("Go");
    line1.addView(btnGo);
    
    ll.addView(line1);
    
    btnGo.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
        String text = "Running: " + tv.getText();
        Toast.makeText(context, text, 2000).show();
      }
    });

    sv.addView(ll);
    return sv;
  }
}

Author comment

Began life as a copy of #676

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1000337
Snippet name: Dummy default code for JavaX/Android 2 (toast only)
Eternal ID of this version: #1000337/1
Text MD5: 59d99a1a7b979f7405064828cd400853
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-23 21:02:36
Source code size: 984 bytes / 37 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 664 / 600
Referenced in: [show references]