Android - 文章列表
-
在应用中调用百度地图和高德地图的方法
百度方式private void openBaiduMap(double lon, double lat, String title, String describle) {try {StringBuilder loc = new StringBuilder();loc.append(\"intent://map/direction?origin=latlng:\");loc.append(lat);loc.append(\",\");loc.append(lon);loc.append(\"|name:\"
-
Android使用Intent打开拨号界面
首先,需要添加权限<uses-permission android:name="android.permission.CALL_PHONE" />1)直接拨打电话Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));startActivity(intentPhone);2)跳转到拨号界面,不拨打Intent intent = newIntent(Intent.ACTION_DIAL,Uri
-
android 横竖屏切换后,界面会重置的解决方法
当屏幕转动切换的时候 Android 机制是:销毁当前屏幕的 Activity ,然后重新开启一个新的适应屏幕改变的 Activity 。那么,我们该如何在屏幕切换的时候页面信息不被重置呢?解决实现:1.在 AnroidMainifest.xml 的 activity 元素中加入:代码如下:android:configChanges="orientation|keyboardHidden"注意:android4.0以上需加入android:configChanges="orientation|keyboardHidden|s
-
android获取手机imei的方法
核心代码:Imei = ((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId();1.加入权限在manifest.xml文件中要添加 <uses-permission android:name="android.permission.READ_PHONE_STATE" />2.代码 /** * **创建日期 2010-4-29 下午05:02:47 * &nb
-
如何让ScrollView内部元素填充match_parent起作用
ScrollView滚动视图是指当拥有很多内容,屏幕显示不完时,需要通过滚动跳来显示的视图。Scrollview的一般用法如下<ScrollView android:layout_width="match_parent" android:layout_height="match_parent"
-
android opengl es简要介绍
什么是OpenGL ES?OpenGL ES (为OpenGL for Embedded System的缩写) 为适用于嵌入式系统的一个免费二维和三维图形库。为桌面版本OpenGL 的一个子集。OpenGL ES 定义了一个在移动平台上能够支持OpenGL最基本功能的精简标准,以适应如手机,PDA或其它消费者移动终端的显示系统。Khronos Group 定义和管理了OpenGL ES标准。OpenGL 与 OpenGL ES的关系OpenGL ES 是基于桌面版本OpenGL 的:OpenGL ES 1.0 基于OpenGL 1.
-
Android notification PendingIntent通知栏传值无效的解决方法
在点击通知栏消息,往应用程序中传递数据时,发现传递的值始终不变。解决方法如下:PendingIntent pIntent = PendingIntent.getActivity(context, iUniqueId, intent, 0);方法中的第二个参数 requestcode传入一个随机数,并且intent的flag设置为Intent.FLAG_ACTIVITY_CLEAR_TOP代码如下:NotificationManager manager = (NotificationManager) getSystemService(Context.NOT
-
如何在项目中引用android.support.v7
1、项目右键 --> import --> Android --> Existing Android Code Into workspace\r\n\r\n --> 选择..\\sdk\\extras\\android\\support\\v7\\appcompat(根据自己的文件存放路径先择)\r\n\r\n --> 勾选copy projects into workspace --> finish\r\n\r\n &
-
jsp提交表单中文乱码的解决方法
<%@ page language=\"java\" import=\"java.util.*\" pageEncoding=\"UTF-8\"%>?<%?request.setCharacterEncoding(\"UTF-8\");?String zh_value=reqeust.getParameter(\"zh_value\");?%>?
-
tomcat 启动时提示error initializing endpoint及端口占用
在cmd中运行startup.bat,提示error initializing endpoint。但是端口确实没被占用原因是同时启用了多个网卡,将多的网卡禁用后,再次启动就成功了