[android-developers] How to inflate a MapView inside a ViewFlipper??

2012-05-09 Thread pedro242
Hi,

I'm stuck in this issue for a while now..  went around forums, books 
(M.Murphy, R.Meier) and I did not find any real helpful threads..

My main activity is  a ListActivity, where the view(main.xml) contains a 
ListView 
and a ViewFlipper
just below. For each selected line in my ListView i want to update the 
content of the ViewFlipper.
Based on two buttons, my ViewFlipper would switch between the  MapView and 
a basic LinearLayout. As far
as i understand i should inflate my MapView but I did not find any 
informatio about how to do that.. 
Of course I'm aware that a MapActivity should appear somewhere..

If someone could provide me a link to a snippet code or answer me with a 
sample code it would be great!!
(the other option is to start a new activity based on a MapActivity where i 
would not need to inflate anthing, but it would not
be so nice)
Thanks,
Pedro

Here below my main.xml:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 !-- android:background=#77ff --

 LinearLayout
 android:id=@+id/linearLayout1
 android:layout_width=fill_parent
 android:layout_height=0dp
 android:layout_weight=0.3 

 Button
 android:id=@+id/prevViewFlipperButt
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:onClick=onPrevChangeViewFlipper
 android:text=PREV /

 Button
 android:id=@+id/nextViewFlipperButt
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:onClick=onNextChangeViewFlipper
 android:text=NEXT /
 /LinearLayout

 ListView
 android:id=@android:id/list
 android:layout_width=fill_parent
 android:layout_height=0dp
 android:layout_weight=1
 android:cacheColorHint=# /

 ViewFlipper
 android:id=@+id/viewFlipperFromListView
 android:layout_width=fill_parent
 android:layout_height=0dp
 android:layout_weight=1 

 include
 android:id=@+id/flipper1
 layout=@layout/details_flipper_view /
   
 include
 android:id=@+id/flipper2
 layout=@layout/map_flipper_view /

 /ViewFlipper

 TextView
 android:id=@+id/selectionTxtView
 android:layout_width=fill_parent
 android:layout_height=0dp
 android:layout_weight=0.3
 android:textSize=44sp /

 /LinearLayout


details_flipper_view.xml:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:id=@+id/PochtroDetailsFlipperLayout
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 TextView
 android:id=@+id/textView1
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:text=Large Text
 android:textAppearance=?android:attr/textAppearanceLarge /

 TextView
 android:id=@+id/textView4
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:text=Small Text
 android:textAppearance=?android:attr/textAppearanceSmall /

 /LinearLayout


map_flipper_view.xml:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
   android:id=@+id/frame android:orientation=vertical
   android:layout_width=wrap_content android:layout_height=wrap_content
   
   com.google.android.maps.MapView
 android:id=@+id/map_view
 android:apiKey=XX
 android:enabled=true
 android:clickable=true
 android:layout_height=wrap_content
 android:layout_width=fill_parent /

 /LinearLayout




 



-- 
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

Re: [android-developers] How to inflate a MapView inside a ViewFlipper??

2012-05-09 Thread TreKing
On Wed, May 9, 2012 at 12:17 PM, pedro242 pedro.contreir...@gmail.comwrote:

 My main activity is  a ListActivity, where the view(main.xml) contains a 
 ListView
 and a ViewFlipper
 just below. For each selected line in my ListView i want to update the
 content of the ViewFlipper.
 Based on two buttons, my ViewFlipper would switch between the  MapView and
 a basic LinearLayout. As far
 as i understand i should inflate my MapView but I did not find any
 informatio about how to do that..
 Of course I'm aware that a MapActivity should appear somewhere..


You'd have to change your main activity from a ListActivity to a
MapActivity and handle the list-related behaviors yourself.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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

Re: [android-developers] How to inflate a MapView inside a ViewFlipper??

2012-05-09 Thread pedro242
Have you ever tried this? Not sure it works, since i will likely face 
another issue in
managing the ListView without the ListActivity...

-- 
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

Re: [android-developers] How to inflate a MapView inside a ViewFlipper??

2012-05-09 Thread Kostya Vasilyev
No such issues. Just try it out.

A MapView is really special and requires a MapActivity.

A ListView does not *require* a ListActivity, it's only there to make
things a tiny bit easier.
09.05.2012 22:02 пользователь pedro242 pedro.contreir...@gmail.com
написал:

 Have you ever tried this? Not sure it works, since i will likely face
 another issue in
 managing the ListView without the ListActivity...

 --
 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

-- 
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

Re: [android-developers] How to inflate a MapView inside a ViewFlipper??

2012-05-09 Thread pedro242

Thanks guys, just tried it out and it works...
But the inflating manner is still confused for me.

-- 
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