어디서 에러가 나는 걸까요?
빨간줄 없이 빌드는 되는데 실행하면 "예상치 않게 중지.." 가뜨네요 ㅠ
package com.android.vpnmanager;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
public class vpnmanager 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();
TabHost tabHost=getTabHost();
TabHost.TabSpec spec;
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.vpn.VpnSettings");
spec=tabHost.newTabSpec("main")
.setIndicator("Main",res.getDrawable(R.drawable.mainicon))
.setContent(intent);
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
}
}
------------------------------main.xml------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout android:id="@+id/FrameLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<TabWidget
android:id="@+id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout android:id="@+id/FrameLayout02" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back"></ImageView>
</FrameLayout>
<AbsoluteLayout android:id="@+id/FrameLayout03" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<TextView android:id="@+id/menu1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="127px" android:layout_y="220px" android:text="About Vpn" android:textColor="#000000"></TextView>
<TextView android:id="@+id/menu2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="98px" android:layout_y="272px" android:text="Create Vpn Account" android:textColor="#000000"></TextView>
<TextView android:id="@+id/menu3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="122px" android:layout_y="324px" android:text="Vpn Settings" android:textColor="#000000"></TextView>
<TextView android:id="@+id/menu4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="120px" android:layout_y="376px" android:text="KTB Solution ?" android:textColor="#000000"></TextView>
<TextView android:id="@+id/menu5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="149px" android:layout_y="428px" android:text="Exit" android:textColor="#000000"></TextView>
</AbsoluteLayout>
</FrameLayout>
</TabHost>
그냥 긁어다 붙여넣기 해주시면;;;
그리고 로그캣 보시고 하나씩 잡아나가세요;;