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