六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 40|回复: 0

android_学习练习1

[复制链接]

升级  10.67%

68

主题

68

主题

68

主题

举人

Rank: 3Rank: 3

积分
232
 楼主| 发表于 2013-1-15 02:49:21 | 显示全部楼层 |阅读模式
TextViewTest.java
package com.hoocy;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class TextViewTest extends Activity {private TextView mTextView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                mTextView = (TextView) findViewById(R.id.hoocy);        String s = "hoocy is good boy";        mTextView.setText(s);    }} 
main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    ><TextView      android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="@string/hello"    /> <TextView android:id="@+id/hoocy" android:text="hoocy hahah" android:layout_width="fill_parent"     android:layout_height="wrap_content"    />   </LinearLayout> 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表