How do I create a box to hold text below Google maps within android?

18 views
Skip to first unread message

and3...@gmail.com

unread,
Feb 19, 2014, 2:17:39 AM2/19/14
to codenameone...@googlegroups.com

At this point I know how to utilize Google Maps within Android but it always seems to take up the full window, there is an image below which shows what I'm attempting to accomplish (having a box below the Google maps where I can store text i.e. "Hello World"

How do I add box below Google Maps, so to store text i.e. "Hello World"

Code so far:

ActivityMain:

public class MainActivity extends Activity {

    private GoogleMap googleMap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        try {
            initilizeMap();

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
    private void initilizeMap() {
        if (googleMap == null) {
            googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                    R.id.map)).getMap();

        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        initilizeMap();
    }

}

Android xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</RelativeLayout>

Image:


Chen Fishbein

unread,
Feb 19, 2014, 5:04:40 AM2/19/14
to codenameone...@googlegroups.com, and3...@gmail.com
Hi,
The forum is for codenameone framework, not general android.

 

 

Reply all
Reply to author
Forward
0 new messages