Reputation: 378
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.
Upvotes: 2
Views: 494
Reputation: 158
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.
Upvotes: 1
Reputation: 5705
In Fragment you should find id's like this
final View view = inflater.inflate(R.layout.blood_request, container, false);
and then
TextView tv_blood_request = (TextView) view.findViewById(R.id.tv_post_request);
Upvotes: 1