![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android
司徒伽澜
这个作者很懒,什么都没留下…
展开
-
android java 拷贝数据库文件到U盘,从U盘拷贝文件到私有目录下实现更新数据库文件
private void copyDB(){ File f = new File("/data/data/xxx/databases/xxx.db"); File o = new File("/storage/udisk/xxx.db"); //sdcard上的目标地址 if(f.exists()) { ...原创 2020-01-07 10:49:43 · 1199 阅读 · 0 评论 -
java Android 生成6位随机数字
//生成6位随机数字 System.out.println((int)((Math.random()*9+1)*100000)); //生成5位随机数字 System.out.println((int)((Math.random()*9+1)*10000)); //生成4位随...原创 2020-01-07 10:01:55 · 1822 阅读 · 0 评论 -
Android布局文件中vertical和horizontal的区别
当 android:orientation=”vertical” 时, 只有水平方向的设置才起作用,垂直方向的设置不起作用。即:left,right,center_horizontal 是生效的。vertical为垂直布局。当 android:orientation=”horizontal” 时, 只有垂直方向的设置才起作用,水平方向的设置不起作用。即:top,bottom,center_ve...原创 2019-12-27 18:04:46 · 3222 阅读 · 0 评论 -
android 判断键盘 输入法 是否弹出
/** * 判断软键盘输入法是否弹出 */ public boolean isKeyboardVisbility(Context context, View v) { InputMethodManager imm = (InputMethodManager) context.getSystemService(context.I...原创 2019-12-19 18:54:04 · 1116 阅读 · 1 评论 -
assets目录下资源拷贝到指定目录
/** * 从assets目录中复制整个文件夹内容 * @param context Context 使用CopyFiles类的Activity * @param oldPath String 原文件路径 如:/aa * @param newPath String 复制后路径 如:xx:/bb/cc */ public void cop原创 2017-09-06 16:20:21 · 576 阅读 · 0 评论 -
android stdio技巧
下载地址 http://www.android-studio.org/\APP下放的是资源自动导入包:勾上“Optimize import on the fly”“Add UNambiguous imports on the fly”快速打印日志:定义TAG生成参数:快捷键设置ctrl+alt+空格 不原创 2017-07-08 18:03:18 · 319 阅读 · 0 评论 -
Android Studio更新2.3后出现Refreshing gradle project.......卡死问题处理步骤
最近网速比较好所以决定更新一下Android Studio,本来是AS2.0版本进入的时候有一个update2.3的选项,我点了一下update没什么卵用0.0,被墙给挡住了,只好自己上网站上自己下一个,装完之后就一直有Refreshing gradle project…….这个进程在跑,只能等待了,然而结果跟大家一样卡住不动了,重启之后还是这样,只能上网找解决方法了,有很多方法感觉不是很适用原创 2017-07-04 12:24:51 · 614 阅读 · 0 评论 -
android studio Session 'app': Error Installing APK解决方案
1.重新编译2.手机拔掉,重新插3.改变android studio的设置,去掉第一个复选框的勾,如下图原创 2017-07-04 12:22:33 · 544 阅读 · 0 评论 -
android音频焦点
AUDIOFOCUS_GAIN指示申请得到的Audio Focus不知道会持续多久,一般是长期占有;AUDIOFOCUS_GAIN_TRANSIENT指示要申请的AudioFocus是暂时性的,会很快用完释放的; AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK不但说要申请的AudioFocus是暂时性的,还指示当前正在使用AudioFocus的可以继续播放原创 2017-06-07 15:04:50 · 537 阅读 · 0 评论 -
android 相对布局RelativeLayout中的一些属性的使用和实例
第一组layout相对布局属性 android:layout_below android:layout_above android:layout_toLeftOf android:layout_toRightOf(注:此属性时写在控件标签内部,用于控制控件的浮动,类似于CSS中的float属性.例子:TextView android:id="@+i原创 2017-06-06 17:10:31 · 729 阅读 · 0 评论 -
android相对布局中编辑框与文本框对其问题
android:layout_alignBaseline="@+id/TextView3"//基准线对其原创 2017-06-06 17:09:34 · 1343 阅读 · 0 评论 -
android新创建Activity在Manifest文件中注册,如何进行注册
原创 2017-06-06 16:57:55 · 12665 阅读 · 0 评论 -
Android中 int 和 String 互相转换的多种方法
1 如何将字串 String 转换成整数 int? A. 有两个方法:1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt([String],[int radix]);2). int i = Integer.valueOf(my_str).intValue(); 注: 字串转成 Double, Float,原创 2017-06-06 16:56:50 · 11194 阅读 · 0 评论 -
Android之获取、设置EditText的文本
String str1=""; EditText editText1 =(EditText)findViewById(R.id.editText1); str1=editText1.getText().toString(); //将文本框1的文本赋给文本框2 EditText editText2原创 2017-06-06 16:55:38 · 17506 阅读 · 3 评论 -
android中怎样将EditText的值转换成Double类型
EditText et = (EditText) findViewById(R.id.height);double height=Double.parseDouble(et.getText().toString());Double.parseDouble()//就可以了原创 2017-06-06 16:54:43 · 2981 阅读 · 0 评论 -
获取cpu序列号
public String[] getCpuInfo() { String str1 = "/proc/cpuinfo"; String str2=""; String[] cpuInfo={"",""}; String[] arrayOfString; try { FileReader fr原创 2017-05-24 11:59:49 · 1491 阅读 · 0 评论 -
adb调起es
adb shell am start -n com.estrongs.android.pop/com.estrongs.android.pop.view.FileExplorerActivity原创 2017-05-24 11:58:00 · 890 阅读 · 0 评论