今天頭一次接觸安卓配置完了之後,新建了一個項目,參考網上的資料,在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" android:gravity="center_horizontal">
  <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="给小宝宝起个名字:" android:textSize="20px" android:textColor="#0ff" android:background="#333" /> 
  <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="遥遥是男孩的小名" android:textSize="20px" android:textColor="#0f0" android:background="#eee" android:layout_weight="3" /> 
  <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="瑶瑶是女孩的小名" android:textColor="#00f" android:textSize="20px" android:background="#ccc" android:layout_weight="1" /> 
  <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="海因是男孩的大名" android:textColor="#f33" android:textSize="20px" android:background="#888" android:layout_weight="1" /> 
  <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="海音是女孩的大名" android:textColor="#ff3" android:textSize="20px" android:background="#333" android:layout_weight="1" /> 
  </LinearLayout>
運行之後怎麼沒有顯示出來?還是顯示那模擬器默認的東西。。應該怎樣操作
我就是 了新建AVD(android vitural device)  
然後在Run Configuration 裏面添加
然後點擊run ...

解决方案 »

  1.   

    提供的信息太少。main.xml没问题,如果模拟器运行良好,显示hello_app的话应该 没有问题。
      

  2.   

    你确定你调用了 setContentView(R.layout.main)吗
      

  3.   

    帮你测试过了,没有半点问题,那就是你点Run时候的一些操作错误吧
    对你的项目点右键,然后指向Run As->Run Configuration->Browse选择你的项目->Target->在你要使用的AVD上打勾->Apply->Run
    成功的话把分给我吧,缺分数请人帮忙啊
      

  4.   


    看下Activity中是不是调用了
      

  5.   

    看一下你的java中有这条吗?
    setContentView(R.layout.main)