Just started working with android and ran into a small problem. I am have a TabActivity that is loading 3 other Activity classes. This works great. I then have a button on the other Activity classes that I would like to launch a MapActivity. When I do that I keep getting a Force Close.
I googled but I cannot figure out if it is the manifest file or something else. The idea is the tabs are showing location information and you click a button to plot it on the map and get directions.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.location_tab);
... Button btnMap = (Button) findViewById(R.id.btnLaunchMap); btnMap.setOnClickListener(mMapListener); }
private OnClickListener mMapListener = new OnClickListener() {
public void onClick(View v) {
Intent mapIntent = new Intent(getApplicationContext(),LocationMap.class);
startActivity(mapIntent);
}
};
If I launch any other activity it works but not launching the mapactivity. If I take the mapactivity class and put it in a new project it works.
My manifest
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Splash"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Locations"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name=".LocationNewYork"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".LocationChicago"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name=".LocationSeattle"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name=".LocationMap"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<uses-library android:name="com.google.android.maps"/>
</application>
thougths?