我是java和android的新手.我的一个Android新闻应用程序我将时间显示为"2014年8月7日上午8:20"
但我需要显示它:
5 mins ago
1 hour ago
2 days ago
Run Code Online (Sandbox Code Playgroud)
发现很多图书馆,比如我们美好的时光,joda.但我不知道如何将其添加到我的Android应用程序.甚至这个链接/sf/answers/911305321/告诉我.但是如何将我的日期和时间传递给它.
任何简单的代码都可以做到.
谢谢
我是Android的新手,我需要在我的应用程序的右上角显示计数.
主页面有一个网格视图.这是页面的xml代码.
我可以从代码中显示圆圈吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/lay_main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#8c5630"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<GridView
android:id="@+id/main_gridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/adView"
android:layout_margin="5dp"
android:layout_marginTop="4dp"
android:horizontalSpacing="10dp"
android:numColumns="2"
android:verticalSpacing="10dp" >
</GridView>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
ads:adSize="BANNER"
ads:adUnitId="@string/admob_id"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" />
</RelativeLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)