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 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 tjis map activity to an ActivityGroup just below a ListAcitivity. The list works just as it should be the map just refuses to render! Even though it doesn't show the map itself I can still se 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!?
Using java Syntax Highlighting
- // 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);
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
As I said before, the ShowMapActivity works just fine on it's own but not when added to this activity group, any suggestions?



