在模拟器中运行android项目时看不到我的屏幕

时间:2012-01-11 06:07:11

标签: android

我正在使用eclipse和ADT,在模拟器中运行我的项目时,我看不到我的屏幕。 enter image description here 这是我的代码:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
       // System.out.println("Hello");
        tv.setText("Hello");
//        setContentView(R.layout.main);
        setContentView(tv);

    }

这是log:

 [2012-01-11 10:57:41 - HelloAndroid] ------------------------------
[2012-01-11 10:57:41 - HelloAndroid] Android Launch!
[2012-01-11 10:57:41 - HelloAndroid] adb is running normally.
[2012-01-11 10:57:41 - HelloAndroid] Performing com.tom.HelloAndroidActivity activity launch
[2012-01-11 10:57:45 - HelloAndroid] Launching a new emulator with Virtual Device 'cupcake'
[2012-01-11 10:57:46 - HelloAndroid] New emulator found: emulator-5554
[2012-01-11 10:57:46 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2012-01-11 10:59:06 - HelloAndroid] HOME is up on device 'emulator-5554'
[2012-01-11 10:59:06 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2012-01-11 10:59:09 - HelloAndroid] Installing HelloAndroid.apk...
[2012-01-11 10:59:55 - HelloAndroid] Success!
[2012-01-11 10:59:55 - HelloAndroid] Starting activity com.tom.HelloAndroidActivity on device emulator-5554
[2012-01-11 11:00:00 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tom/.HelloAndroidActivity }

以下信息可能有所帮助:

E:\DevelopTool\Android\android-sdk_r15-windows\tools>android list targets
Available Android targets:
----------
id: 1 or "android-14"
     Name: Android 4.0
     Type: Platform
     API level: 14
     Revision: 3
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800
     ABIs : armeabi-v7a
----------
id: 2 or "android-15"
     Name: Android 4.0.3
     Type: Platform
     API level: 15
     Revision: 1
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800
     ABIs : armeabi-v7a
E:\DevelopTool\Android\android-sdk_r15-windows\tools>android list avd
Available Android Virtual Devices:
    Name: cupcake
    Path: D:\Users\WE\.android\avd\cupcake.avd
  Target: Android 4.0 (API level 14)
     ABI: armeabi-v7a
    Skin: WVGA800
---------
    Name: Test
    Path: D:\Users\WE\.android\avd\Test.avd
  Target: Android 4.0 (API level 14)
     ABI: armeabi-v7a
    Skin: WVGA800
  Sdcard: 8G

1 个答案:

答案 0 :(得分:2)

你要把锁定的东西拉到右侧以解锁屏幕然后你就能看到它。