
Sono convinto che questa scena potrebbe ripetersi tranquillamente al tech support di Microsoft...
import android.app.Activity;E quello che è uscito per ora sono un pulsante e del testo.
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
public class bt_tryout extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
RelativeLayout rt = new RelativeLayout(this);
final Button bt = new Button(this);
LayoutParams lp_bt = new LayoutParams(200,50);
LayoutParams lp_tv = new LayoutParams(500,100);
TextView tv = new TextView(this);
/**Setting up the UI*/
bt.setText("Bottone");
bt.setLayoutParams(lp_bt);
tv.setText("Ciao zia :)");
tv.setLayoutParams(lp_tv);
lp_tv.topMargin = 60;
rt.addView(tv);
rt.addView(bt);
/**
* Now we try to write a simple onClick event,
* to change the TextView.tv.
*/
setContentView(rt);
}
}