Android - 文章列表

共 11 页

  • android选择文件,通过uri获取文件真实地址的方法(兼容7.0)

    1、发起选择文件的请求Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType(*/*);intent.addCategory(Intent.CATEGORY_OPENABLE);((Activity)context).startActivityForResult(Intent.createChooser(intent,请选择

  • Android 7.0的手机在eclipse上无法显示logcat的解决方法

    Android7.0的手机在eclipse上无法显示调试信息logcat的解决方法需要下载ADT-24.2.0下载地址:https://github.com/khaledev/ADT/releases或http://pan.baidu.com/s/1gfFX5HxADT使用方法下载文件后在Eclipse中点击目录HelpInstallNewSoftware...AddArchive...然后选择下

  • swift 播放网络音频

    var audioPlayer:AVAudioPlayer!func playsong(musicdata:NSData){    do{        try audioPlayer = AVAudioPlayer(data: musicdata)        audioPlayer.prepareToPlay()        audioPlayer.play()    }catch {&n

  • 在应用中调用百度地图和高德地图的方法

    百度方式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