简体   繁体   中英

Android Emulator still showing Hello World

So I've set up my Eclipse to have the Android SDK and ADT plugin.

I set up my AVD to have a Galaxy Nexus and Galaxy S2 emulator.

I've created a new Android project and I get my blank MainActivity which simply displays "Hello World!" which is the problem.

In the Graphical Layout, I delete the "Hello World!" text to remove it. I check in the activity_main.xml and the script containing the "Hello World!" text is no longer there. I run in either emulator and everything works, but when the app opens, "Hello World!" is still there.

Here's the xml now

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.project.MainActivity"
tools:ignore="MergeRootFrame" />

I've changed nothing except removing that text. The MainActivity.java has not been touched. Is there something I'm missing?

这对我来说有点奇怪,只需从fragment.xml文件中删除Hello World Text View,就可以了。

that xml code is just for layout when you add smthg on layout this code will be bigger,example

<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"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >
 <Button
        android:id="@+id/bb"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/editText1"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="72dp"
        android:text="git" />

thats have only a button your code has nothing only layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM