当前位置: 编程技术>移动开发
本页文章导读:
▪关于一个程序中多个Notification的精确统制 关于一个程序中多个Notification的精确控制
Problem: When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.p.........
▪ 设立图片固定大小,且保持图片宽高比 设置图片固定大小,且保持图片宽高比
如需转载请著名
作者:倚风听雪 来源:http://hklongshao.iteye.com
如果想设置图片固定大小,又想保持图片宽高比,需要如下设.........
▪ 设立显示窗口横向不可改变 设置显示窗口横向不可改变
如需转载请著名 作者:倚风听雪 来源:http://hklongshao.iteye.com 横竖屏设置,在AndroidManifest.xml里面配置一下android:screenOrientation="landscape"(landscape是横向,.........
[1]关于一个程序中多个Notification的精确统制
来源: 互联网 发布时间: 2014-02-18
关于一个程序中多个Notification的精确控制
Problem:
When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId.
Answer:
I got the answer. The intents were getting cached in. To, make a new intent, just add the following piece of code:
This makes the intent unique.
Also, someone suggested me the following piece of code to make the intent unique:
It didnt help me, but might be of help to someone else.
Problem:
When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId.
Answer:
I got the answer. The intents were getting cached in. To, make a new intent, just add the following piece of code:
intent.setData((Uri.parse("custom://"+System.currentTimeMillis())));
This makes the intent unique.
Also, someone suggested me the following piece of code to make the intent unique:
intent.setAction("actionstring" + System.currentTimeMillis());
It didnt help me, but might be of help to someone else.
1 楼
272152441
2011-10-18
Thank you very much.
[2] 设立图片固定大小,且保持图片宽高比
来源: 互联网 发布时间: 2014-02-18
设置图片固定大小,且保持图片宽高比
如需转载请著名
作者:倚风听雪 来源:http://hklongshao.iteye.com
如果想设置图片固定大小,又想保持图片宽高比,需要如下设置:
1 ) 设置 setAdjustViewBounds 为 true ;
2 ) 设置 maxWidth 、 MaxHeight ;
3 ) 设置设置 layout_width 和 layout_height 为 wrap_content 。
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10px" > <ImageView android:adjustViewBounds="true" android:layout_width="fill_parent" android:layout_height="160px" android:scaleType="fitCenter" android:layout_gravity="center" android:src="/blog_article/@drawable/icon/index.html" /> </LinearLayout>
[3] 设立显示窗口横向不可改变
来源: 互联网 发布时间: 2014-02-18
设置显示窗口横向不可改变
如需转载请著名
作者:倚风听雪 来源:http://hklongshao.iteye.com
横竖屏设置,在AndroidManifest.xml里面配置一下
android:screenOrientation="landscape"
(landscape是横向,portrait是纵向)
如需转载请著名
作者:倚风听雪 来源:http://hklongshao.iteye.com
横竖屏设置,在AndroidManifest.xml里面配置一下
android:screenOrientation="landscape"
(landscape是横向,portrait是纵向)
最新技术文章: