0
我的应用程序都不在模拟器中工作。我运行Ubuntu 9.10,每次尝试访问我的用户界面时,应用程序都会崩溃。我所得到的只是一个“对不起!应用程序意外停止”。对于每个应用程序,都会发生Android应用程序不能在模拟器中工作
package com.mohit.helloandroid;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
public class HelloAndroid extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources(); //Resource object to get drawables
TabHost tabHost = getTabHost(); //The activity tabhost
TabHost.TabSpec spec; //Reusable tab spec
Intent intent;
intent = new Intent().setClass(this, HelloAndroid.class);
spec = tabHost.newTabSpec("artists").setIndicator("Artists", res
.getDrawable(R.drawable.tab_artists))
.setContent(intent);
tabHost.addTab(spec);
}
}
我不知道这段代码如何可能抛出这样的消息。
你可以发布你从日志中获得的异常吗? – haseman 2010-05-05 22:35:42
没有例外。这就是我困惑的原因。 – 2010-05-05 23:17:14
你能发布你的布局XML和你的androidManifest XML吗? – Mark 2010-05-06 00:37:22