import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import java.math.*; import android.app.*; import android.widget.*; import android.view.*; import android.view.KeyEvent; import android.view.inputmethod.*; import android.text.*; public class main { static Activity androidContext; public static void main(String[] args) throws Exception { androidContext.runOnUiThread(new Runnable() { public void run() { try { Activity context = androidContext; LinearLayout ll = new LinearLayout(context); ll.setOrientation(ll.VERTICAL); final TextView tv = new TextView(context); tv.setText("Hello\nworld"); tv.setBackgroundColor(0xFFFFFFCC); ScrollView sv = new ScrollView(context); sv.setBackgroundColor(0xFFFFFFCC); sv.addView(tv); //sv.setGravity(Gravity.FILL_VERTICAL); sv.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)); ll.addView(sv); final EditText et = new EditText(context); et.setInputType(InputType.TYPE_CLASS_TEXT); // Hopefully turns off multiline et.setOnEditorActionListener(new TextView.OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) { tv.setText("Yo: " + et.getText()); } return false; } }); ll.addView(et); context.setContentView(ll); } catch (Exception __e) { throw __e instanceof RuntimeException ? (RuntimeException) __e : new RuntimeException(__e); }}}); } }