-
difference between clear data and clear cache ? Android
setting中清除代码 1: 清空缓存 packageManager 中 packageManagerService -> deleteApplicationCacheFilesAsUser( final UserEnvironment
16lz2021-01-2347 -
android deal with big images
// Deal with big image that size more 8M BitmapFactory.Options option = new BitmapFactory.Options(); option.inTempStorage = new byte[1024*1024*5]; B
16lz2021-01-2338 -
Android 自定义View 基础知识
一.自定义View构造方法说明 1.构造方法1 public MyView(Context context) { super(context);} 2.构造方法2 public MyView(Context context,Att
16lz2021-01-2388 -
Android下内核配置make menuconfig出现一大堆未定义的错误
运行 make menuconfig 后出现一大堆: ...........menubox.c:(.text+0xa86): undefined reference to `delwin'menubox.c:(.text+0xbbc): undefin
16lz2021-01-23146 -
Android 隐藏显示软键盘的终极方法
隐藏软键盘的终极方法: public class SoftKeyboardUtil { /** * 隐藏软键盘(只适用于Activity,不适用于Fragment) */ public static void hideSoftKeyboard(Activ
16lz2021-01-23203 -
android viewpaper嵌套viewpaper,滑动问题解决
两个viewpaper嵌套, 滑动会有冲突。 解决方案: 自定义父对象。 public class MyViewPaper extends ViewPager {public MyViewPaper(Context context, AttributeSet attrs)
16lz2021-01-23122 -
Android POST data and COOKIES
转自http://stackoverflow.com/questions/3152740/android-post-data-and-cookies in Java HttpURLConnection you can set / get a cookie this way (here is t
16lz2021-01-2355 -
android 带清除功能的输入框控件
今天,看到一个很好的自定义输入框控件,于是记录一下。 效果很好: 一,自定义一个类,名为ClearEditText package com.example.clearedittext;import android.content.Context;im......
16lz2021-01-23121 -
把android assets文件夹内的文件存储到sd卡中
原文:http://mobile.51cto.com/aprogram-387591.htm /** * 存资源在data中 * @param ctxDealFile applicationContext * @param path */ pu
16lz2021-01-23134 -
关于CTS中android.permission.cts.DebuggableTest# testNoDebuggable Fail
这个一般只是出错的应用的AndroidManifest.xml中有个字段值不对。 Android:debuggableWhether or not the application can be debugged, even when running on a device in u
16lz2021-01-2345 -
Android 错误:IllegalStateException: Can not perform this action after onSaveInstanceState
今天做Fragment切换、状态保存功能的时候,出现了这个错误: E/AndroidRuntime(12747): Caused by: java.lang.IllegalStateException: Can not perform this action after onSave
16lz2021-01-23140 -
Android中view的Touch事件传递顺序
先看一下ViewGroup的dispatchTouchEvent的关键源码: public boolean dispatchTouchEvent(MotionEvent ev) {... if (action == MotionEvent.ACTION_DOWN) {..
16lz2021-01-23112 -
Android Architecture Components 之 ViewModel的源码分析
ViewModel 参考:https://blog.csdn.net/u010072711/article/details/80035276 创建 val viewModelProvider = ViewModelProviders.of(_mActivity,viewMo
16lz2021-01-2391 -
将Canvas保存为一个bitmap
int w = 320,h = 240;String mstrTitle = “感受Android带给我们的新体验”;Bitmap mbmpTest = Bitmap.createBitmap(w,h, Config.ARGB_8888);Canvas canvasTemp = new
16lz2021-01-2338 -
Android中获取设备的IP
在wifi环境下,可以通过WifiInfo来获取设备的ip public String getIpAddress() {WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);WifiInfo wifiInfo
16lz2021-01-23130 -
Android前端通过Http协议与J2EE后端数据交互。工具eclipse、MySQL、Tomcat。通过JoSn获取数据。Android端实现对MySQL增删改查功能。
Android:目录 HttpThread.java package com.example.saads; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStrea
16lz2021-01-23131 -
关于Android屏幕密度与分辨率
DisplayMetrics dm = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);//获取像素int widthPixels= dm.widthPixels;int heightPix
16lz2021-01-23153 -
Android自定义dialog简单实现方法
本文实例讲述了Android自定义dialog简单实现方法。分享给大家供大家参考,具体如下: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceStat
16lz2021-01-23160 -
Android中发短信的代码
SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage("接收短信的手机号码", null, "Hello, friend. I'm your friend. Android test.", null, null);
16lz2021-01-23133 -
Android studio工程有重复包时报错
android studio报如下错误,java虚拟机结束异常: Error:Execution failed for task ‘:dong:dexDebug’. > com.android.ide.common.process.ProcessException:org.gradl
16lz2021-01-2388 -
对于 Error:Could not find com.android.tools.build:gradle:3.0.0. 这种问题的解决方案
Error:Could not find com.android.tools.build:gradle:3.0.0.Searched in the following locations: file:/F:/Android/Android Studio/gradle/m2repo
16lz2021-01-2334 -
Android -- 多页滑动(ViewPager)
直接上代码: activity_main.xml: ?xml version="1.0" encoding="utf-8"?>
16lz2021-01-2337 -
Android Service 中 onStartCommand()函数返回值含义
onStartCommand()是由Android系统调用的,本质上也是调用了onStart()方法。 onStartCommand()返回值有几种: 1)START_STICKY 英文解释: Constant to return from onStartCommand: if
16lz2021-01-23121 -
android使用sharedPreferences()方法读写文件操作
写入文件 @Override public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()){ //存储数据
16lz2021-01-23151 -
apktool高版本产生compileSdkVersion等错误
No resource identifier产生compileSdkVersion等错误 自动反编译工具引发了一个错误: No resource identifier found for attribute ‘compileSdkVersion
16lz2021-01-23135