当前位置:编程学习 > wap >>

求助:模拟器不现实helloword。

各位大侠们好,本人第一天学习Andriod。编了第一个程序,显示helloword!可模拟器不显示。求助:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/test"
        
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/hello_world" />

</RelativeLayout>



package com.example.lz;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView tv = (TextView)findViewById(R.id.test);
        tv.setText("helloword");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
}


谢谢大家帮忙看看啊?

--------------------编程问答-------------------- <TextView
         android:id="@+id/test"
                  android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:layout_centerVertical="true"
         android:text="@string/hello_world" 

      android:textColor="#000000"
       android:textSize="100dp"
/>
加多两句      android:textColor="#000000"
            android:textSize="100dp"
  --------------------编程问答-------------------- 默认的就是hello world 呀,怎么可能会运行不了呢?,报错你应该贴出了呀 --------------------编程问答--------------------
引用 2 楼 gaofeng2009123 的回复:
默认的就是hello world 呀,怎么可能会运行不了呢?,报错你应该贴出了呀
--------------------编程问答-------------------- 默认的就是helloworld,看环境是否配好了 --------------------编程问答--------------------
引用 4 楼 goog_guzl 的回复:
默认的就是helloworld,看环境是否配好了

是的,环境变量没配置好,害的我搞了两天,重新下的SDK。重新配置的。谢谢大家的指点!!
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,