1

I have two activities, ListViewActivity and MapViewActivity which both run within a TabHost; everything is working fine and I am able to view my list, add POIs to the map, change between tabs etc.

What I have also done is to 'extend' my ListViewActivity so that when an item in the List is clicked, the view is switched (via ViewSwitcher) to show more detail (note: this happens within the same tab); again this all works okay and I am able to flip between the list view and the detailed view which contains text elements, buttons etc.

But, since I've only been programming in Android/JAVA for a few weeks, I've hit a brick wall... and need some pointers/high level examples to get me going again.

  <com.google.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:apiKey="0sQLOXF5j7iM03sd-IyVldoGjh0voa5-qqFRRlw"
    android:clickable="false"
    android:enabled="true" />

Specifically, I want the 'extended/detailed' view within the ListViewActivity to include a detailed/zoomed map. However, when I try to include the map definition in my XML code (see above), it causes the application to crash - I am assuming because there is already a map defined in MapViewActivity (i.e. this code appears in both my ListViewActivity.xml and my MapViewActivity.xml files)?

I've read found other pages such as this, which recommend using the android:process attribute in the manifest to assign acitivites, for example:

activity android:name=".activity.directory.MapView1" android:process=":MapView1"
activity android:name=".activity.directory.MapView2" android:process=":MapView2"

However, I am uncertain how to implement this - i.e. how do I call the process from either the ListViewActivity or MapViewActivity class such that either a detailed or high-level map is displayed?

Currrently my AndroidManifest.XML file is as shown below; I know this is incorrect, but like I said, I'm stuck in figuring out how to have a map both in my ListViewActivity and in my MapViewActivity:

  <application
    android:icon="@drawable/launcher"
    android:label="@string/app_name" >
    <activity
        android:label="@string/app_name"
        android:name=".DummyAppName" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".ListViewActivity"/>
    <activity android:name=".MapViewActivity"/>
    <activity android:name=".FavouritesActivity"/>
    <activity android:name=".SettingsActivity"/>
    <activity android:name=".activity.directory.MapView1" android:process=":MapView1"/>
    <activity android:name=".activity.directory.MapView2" android:process=":MapView2"/>

Sorry for the long post. I hope it makes sense and I hope someone is able to offer some ideas/suggestions on how to fix my problem (is it even possible?).

Thank you!

Community
  • 1
  • 1
Kevin
  • 63
  • 1
  • 2
  • 6

0 Answers0