Hi!

I originaly posted this thread in beginners but it's maybe not a
beginners question so I'll try it out here instead.

I have a slight problem with my android application. My thought was
to
re-use as many acitivites as possible in different places so I
thought
an activity group would be the best shot for me to use in some places
and hence I would be able to re-use my map activity and a couple of
ListActivities.


On one screen I have a "standalone" map, that is, a map ativity shown
over the entire screen and that works just fine. The problem comes
when I try to add this map activity to an ActivityGroup just below a
ListAcitivity. The list works just as it should but the map just
refuses to render itself! (I can see the "Google" text and the
background). Even though it doesn't show the map itself I can still
see how the map keeps switching position when i click something
in my list (tells it to move to the adress specified in the list). I
really don't get it, there must be something I forgot to do when
adding the MapActivity to the ActivityGroup!?


-----Java begin ----------
// create new LinearLayout and
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.FILL_PARENT,
                    LinearLayout.LayoutParams.WRAP_CONTENT);
LinearLayout l = new LinearLayout(this);
l.setLayoutParams(lp);
l.setOrientation(LinearLayout.VERTICAL);


LocalActivityManager localActivityManager = this
                    .getLocalActivityManager();


// our 2 different intents to be started.
Intent map = new Intent(this, ShowMapActivity.class);
Intent hallplatser = new Intent
(this,ListaHallplatserINarhetenActivity.class);


// start the activities
View mapview = localActivityManager.startActivity(KARTA_ID, map )
                    .getDecorView();
View hallplatsview = localActivityManager.startActivity(HALLPLATS_ID,
                    hallplatser).getDecorView();


WindowManager w = getWindowManager();
Display d = w.getDefaultDisplay();
int width = d.getWidth();
int height = d.getHeight();
map view.setLayoutParams(new ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.FILL_PARENT, height / 2));
hallplatsview.setLayoutParams(new ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.FILL_PARENT, height / 2));


// add the both views to the linearlayout and set it as the
contentview
l.addView(hallplatsview);
l.addView(mapview);


setContentView(l);


---- Java end ------


As I said before, the ShowMapActivity works just fine on it's own but
not when added to this activity group, any suggestions? :) All
permissions are also set (of course since the map works just fine
normally). Is this maybe a bug? Tried in emulator and HTC Hero running
SDK 1.5.


/ Ulf

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to