header.xml
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/txtTime"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:gravity="right" />
</LinearLayout>
i added header.xml in all my screen layouts…
<include
android:id="@+id/top_header"
layout="@layout/header" />
Now i want start timer and set text of every remaining seconds in text header txtTime…
So which screen i write code for countdown timer and set textview so all screen display time in textview..
can any one suggest me its possible to set text only one screen and display in all screen ?
Thanks
Please try below code . It will solve your prolem.
Follow below steps.
Here i post all the classes you required .
What i do in BaseActivity ?
BaseActivity
MainActivity
activity_main.xml
SecondActivity
second_activity.xml
header.xml