Search code examples
androidtextviewandroid-4.4-kitkatsupportmapfragment

android textview not visible over map fragment in android 4.4.2 but visible in lollipop device


I am developing an android app using SupportMapFragment map display the map is working fine the issue is textView, I Want to display some text over the MapFragment I've defined the layout like this:

gpsTxtView=(TextView)findViewById(R.id.GPS);

set the text like this:

gpsTxtView.setText("Last Halt: \n" + new SimpleDateFormat("MMM dd yyyy hh:mm:ss").format(date));

and the xml for this:

`<FrameLayout
    android:id="@+id/mapLL"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        android:id="@+id/tool_bar_detail"
        layout="@layout/tool_bar_detail"
        android:layout_width="match_parent"
        android:layout_height="48sp" />

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

       <TextView
        android:id="@+id/GPS"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|left"
        android:layout_marginBottom="30sp"
        android:layout_marginLeft="5sp"
        android:text=""
        android:textColor="@android:color/holo_red_dark"
        android:textSize="16sp"
        android:textStyle="bold" />

</FrameLayout> `

like we generally do the thing I couldn't figure out is why it's not working in the android 4.4.2 (micromax p480 Tab)and working in android lollipop (yu Yureka) will be thankful if somebody suggest some solution for this. Thanks.


Solution

  • I just check your code. Every thing is fine in the code. So, for testing you can do one thing. put some hard coded values and then check , values are reflecting in TextView or not. So then you can conclude that would be something wrong in your way of fetching data.

    One thing also i want to suggest , if you are getting date in your data. then pass the Locale, this might be an issue.