in this i am trying to get only hour from the textclock and show on my widget and it works perfectly on Android device and when test on BlackBerry it shows complete time like 12:50 PM instead of hour
<TextClock
android:id="@+id/tvHourWidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:format12Hour="hh"
android:text="00"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/basic_twice" />
here is the code i have tried
You cannot set whether a device is 12-hour or 24-hour format, nor can you set that in your TextView
. Hence, you'll have to use both format12Hour
and format24Hour
attributes to ensure that in both cases, the format will be hh
:
<TextClock
android:id="@+id/tvHourWidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:format12Hour="hh"
android:format24Hour="hh"
android:text="00"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/basic_twice" />