package com.android.myfirstandroidapp;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;import android.widget.LinearLayout;public class MyFirstAndroidAppActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                // 使用代码动态布局界面的例子        TextView text1 = new TextView(this);        text1.setText("Hi there!");                TextView text2 = new TextView(this);        text2.setText("I'm seconed. I need to wrap.");        text2.setTextSize( (float)60 );                LinearLayout ll = new LinearLayout(this);        ll.setOrientation(LinearLayout.VERTICAL);        ll.addView(text1);        ll.addView(text2);                setContentView(ll);            }}

更多相关文章

  1. android代码混淆后gson无法解析问题
  2. Android(安卓)anr异常测试
  3. Android(安卓)界面的横竖屏监听
  4. Android(安卓)SDK 源代码编译
  5. Android简单计算器界面实现
  6. 获取Android设备IMEI
  7. android的单选框例子
  8. android 混编源代码
  9. Android(安卓)ProgressBar简单使用

随机推荐

  1. android 10.0版本合入GMS包
  2. Android(安卓)Studio 通过无线wifi连接设
  3. Airplane mode的三种切换方式
  4. Android第一行代码第二版:5.3.2发送有序广
  5. Android中的RectF类和PointF类
  6. 64位系统中安装Android(安卓)SDK“系统找
  7. android error统计
  8. android数据库(随apk一起发布数据库)
  9. android TextView 改变边框
  10. Android(安卓)ListView缓存惹得祸