1 | import android.view.*; |
2 | import android.widget.*; |
3 | import android.content.Context; |
4 | |
5 | public class main { |
6 | public static View main(final Context context) { |
7 | ScrollView sv = new ScrollView(context); |
8 | LinearLayout ll = new LinearLayout(context); |
9 | ll.setOrientation(LinearLayout.VERTICAL); |
10 | |
11 | LinearLayout line1 = new LinearLayout(context); |
12 | |
13 | TextView label = new TextView(context); |
14 | label.setText("Run which snippet ID?"); |
15 | line1.addView(label); |
16 | |
17 | final EditText tv = new EditText(context); |
18 | tv.setText("675"); |
19 | line1.addView(tv); |
20 | |
21 | Button btnGo = new Button(context); |
22 | btnGo.setText("Go"); |
23 | line1.addView(btnGo); |
24 | |
25 | ll.addView(line1); |
26 | |
27 | btnGo.setOnClickListener(new View.OnClickListener() { |
28 | public void onClick(View v) { |
29 | String text = "Running: " + tv.getText(); |
30 | Toast.makeText(context, text, 2000).show(); |
31 | } |
32 | }); |
33 | |
34 | sv.addView(ll); |
35 | return sv; |
36 | } |
37 | } |
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: | 606 / 533 |
Referenced in: | [show references] |