![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
flyfight88
这个作者很懒,什么都没留下…
展开
-
RelativeLayout布局中控件常用布局属性
第一类:属性值为true或false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android:layout_centerInparent 相对于父元素完全居中 android:layout_alignParentBottom 贴紧父元素转载 2013-02-16 15:21:50 · 736 阅读 · 0 评论 -
Android 启动另一个apk
Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER); ComponentName cn = new ComponentName("com.anhuioss.simpleime", "com.anhuioss.simpleime.settin原创 2013-05-16 10:14:36 · 2128 阅读 · 0 评论 -
有关Android线程的学习
1. Android进程 在了解Android线程之前得先了解一下Android的进程。当一个程序第一次启动的时候,Android会启动一个LINUX进程和一个主线程。默认的情况下,所有该程序的组件都将在该进程和线程中运行。同时,Android会为每个应用程序分配一个单独的LINUX用户。Android会尽量保留一个正在运行进程,只在内存资源出现不足时,Android会尝试停止一些进转载 2013-09-23 14:44:08 · 1108 阅读 · 0 评论 -
Android文件系统的结构及目录用途、操作方法
以下内容转载1、android文件系统的结构android源码编译后得到system.img,ramdisk.img,userdata.img映像文件。其中, ramdisk.img是emulator的文件系统,system.img包括了主要的包、库等文件,userdata.img包括了一些用户数据,emulator加载这3个映像文件后,会把 system和 userdata分别加转载 2013-09-25 10:26:48 · 2235 阅读 · 0 评论 -
Android 杂记
Android中静态jar库如何编译static jar library.# Note: the source code is in java/, not src/, because this code is also part of # the framework library, and build/core/pathmap.mk expects a jav转载 2013-08-20 09:26:39 · 1024 阅读 · 0 评论 -
Android Application Stack Task Activities的关系
什么是Android Application?简单来说,一个apk文件就是一个Application。任何一个Android Application基本上是由一些Activities组成,当用户与应用程序交互时其所包含的部分Activities具有紧密的逻辑关系,或者各自独立处理不同的响应。这些Activities捆绑在一起成为了一个处理特定需求的Application,转载 2013-09-29 10:54:07 · 1009 阅读 · 0 评论 -
ByteArrayOutputStream的用法
ByteArrayOutputStream类是在创建它的实例时,程序内部创建一个byte型别数组的缓冲区,然后利用ByteArrayOutputStream和ByteArrayInputStream的实例向数组中写入或读出byte型数据。在网络传输中我们往往要传输很多变量,我们可以利用ByteArrayOutputStream把所有的变量收集到一起,然后一次性把数据发送出去。具体用法如下:转载 2013-10-24 11:02:18 · 2452 阅读 · 0 评论 -
解决support包引起的AndroidStudio编译报错
有时我们在引用support包的时候会遇到下面的错误,AGPBI: {"kind":"error","text":"error: resource android:attr/colorError not found.","sources":[{"file":"C:\\Users\\qwe\\.gradle\\caches\\transforms-1\\files-1.1原创 2018-10-16 14:34:06 · 30776 阅读 · 2 评论 -
Android手机访问正规https网站,第一次请求报Trust anchor for certification path not found,之后又可以正常访问的问题排查。
今天在访问一个正规https网站的时候发现第一次请求报错:javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found然后之后发请求就成功返回了。折腾了半天,还照着网上的方法忽略https校验,...原创 2018-11-15 09:56:14 · 9702 阅读 · 5 评论 -
强制改变默认输入法
package com.example.testchangeinput;import android.os.Bundle;import android.app.Activity;import android.content.Context;import android.view.inputmethod.InputMethodManager;public class Ma原创 2013-05-20 16:41:06 · 1183 阅读 · 0 评论 -
android 工程源码下编译 Android.mk写法
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE_TAGS := optionLOCAL_SRC_FILES := $(call all-java-files-under, src)LOCAL_SDK_VERSION := currentLOCAL_PACKAGE_NAME := ChangeIn原创 2013-05-20 16:09:00 · 908 阅读 · 0 评论 -
Android Handler简单例子
package com.example.handler;import android.os.Bundle;import android.app.Activity;import android.app.ProgressDialog;import android.content.res.Resources;import android.os.Handler;import android.原创 2013-02-21 14:22:34 · 3685 阅读 · 1 评论 -
开启Android程序时检测网络与GPS是否打开
很多android程序在打开时,都需要检测网络是否连接,或者GPS是否可用:1.网络是否连接(包括Wifi和移动网络) // 是否有可用网络 private boolean isNetworkConnected() { ConnectivityManager cm = (Connecti转载 2013-02-22 11:15:34 · 3660 阅读 · 0 评论 -
Android的AlertDialog详解
转自:http://www.2cto.com/kf/201205/131876.html参考文章:http://www.cnblogs.com/jiezzy/archive/2012/09/20/2694917.html http://blog.csdn.net/lizzy115/article/details/6924416AlertDialog的构造方转载 2013-02-22 13:34:52 · 37756 阅读 · 5 评论 -
Android sensor开关问题
今天做了一个TabHost 的小DEMO,其中有一个标签页(tab1)要强制横屏,其他标签横竖屏根据sensor感应自动改变。开始是在AndroidManifest.xml中加入android:screenOrientation="sensor",然后在tab1代码段加入了setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDS原创 2013-02-25 14:46:36 · 2069 阅读 · 0 评论 -
Android 控件最上层显示方法
view.bringToFront() 可以讲布局在下层的控件放到上层,不被其他控件挡住。原创 2013-03-15 09:00:24 · 47863 阅读 · 12 评论 -
startActivityForResult() 跳转回来而没调用onActivityResult()
当前Activity调用Google语音功能 用了startActivityForResult(),发现调用完毕回到主Activity的时候发现没调用onActivityResult(),就直接退出了。网上找了很多方法,有说requestCode值要大于1的,有说intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);这句不能加的,有说AndroidManif原创 2013-03-15 14:25:07 · 4193 阅读 · 0 评论 -
Handler.post()解决非主线程更新UI
在非主线程中调用了showMessage方法,结果报错:Can't create handler inside thread that has not called Looper.prepare()private void showMessage(String msg) { Toast toast = Toast.makeText(getApplicationContext原创 2013-04-03 09:21:41 · 4455 阅读 · 2 评论 -
monkey test
adb -s 0149C6EB0102000C shell monkey -p com.feiying.android.apps.tvremote --monitor-native-crashes -v 5000000 > ~/monkey/monkey0401.log原创 2013-04-03 09:08:43 · 860 阅读 · 0 评论 -
Android service传递的问题
主Activity里bindService建了一个Service,然后将此Service通过构造方法传给子类B,class B(Service service) { mBservice = service;}之后主Activity调用B类的testb()方法testb() {log.i(TAG,""+mBservice.num); //num是service原创 2013-03-21 15:38:00 · 1660 阅读 · 0 评论 -
Android onClick onTouch事件关联
Button的onTouch,onClick,onLongClick事件发生先后顺序和关联:一,onTouch返回false首先是onTouch事件的down事件发生,此时,如果长按,触发onLongClick事件;然后是onTouch事件的up事件发生,up完毕,最后触发onClick事件。二,onTouch返回true首先是onTouch事件的down事件发生,然后是onTouch转载 2013-03-25 09:06:16 · 1361 阅读 · 0 评论 -
扩大AppCompatCheckBox点击区域(点击外部ViewGroup,内部AppCompatCheckBox选中状态切换)
<com.demo.CheckableLinearLayout android:layout_width="100dp" android:layout_height="100dp" android:background="#00ff00" android:gravity="center" android...原创 2018-12-12 09:35:58 · 907 阅读 · 0 评论