![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
android
文章平均质量分 63
qq_38922435
这个作者很懒,什么都没留下…
展开
-
常用APP(apk)对应包名总结(持续更新...)
//微信 包名 com.tencent.mm //启动类名:com.tencent.mm.ui.LauncherUI//QQ 包名 com.tencent.mobileqq //启动类名:com.tencent.mobileqq.activity.HomeActivity//支付宝 包名:com.eg.android.AlipayGphone //启动类名com.eg.android.AlipayGphone.FastStartActivity//钉钉 包名:com.alibaba....原创 2021-02-14 20:06:28 · 5654 阅读 · 2 评论 -
解决Android模拟器可以发送验证码但是真机测试却发不出去。
今天遇到一个让人非常郁闷的问题,模拟器可以发送短信验证码,但是真机连接电脑却不能发送短信验证码,百度了半天才解决,原来是因为我电脑的防火墙开启了,必须要关掉电脑的防火墙才可以。下面是关闭防火墙的方法https://jingyan.baidu.com/article/ca41422fe9462c1eae99edb5.html补充一下:昨天遇到的问题今天又遇到了,关闭了防火墙也无效,原来是...原创 2019-11-22 17:42:17 · 3873 阅读 · 1 评论 -
Android解决Handler报错的问题
AsyncHttpResponseHandler使用过程中报错,无法引入org.apache.http.Header在使用ANdroidStudio时,采用高编译版本版本android6.0,报错,引用的org.apache.http.Header类找不到。Android 6.0 release removes support for the Apache HTTP client.说Apa...原创 2019-10-24 19:36:19 · 1177 阅读 · 0 评论 -
Android隐藏标题栏无效的解决办法
有时候我们会发现 requestWindowFeature(Window.FEATURE_NO_TITLE);隐藏标题无效,把AppCompatActivity改成Activity问题就解决了。/**把AppCompatActivity 改成 Activity隐藏标题兰才有想过*/public class MainActivity extends Activity { priv...原创 2019-10-24 10:13:41 · 435 阅读 · 0 评论 -
Android之Intent携带参数跳转到指定的Activity并取出值显示在UI页面
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-28 16:11:16 · 2538 阅读 · 0 评论 -
Android的SimpleAdapter适配器和List的配合的使用
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-26 19:32:23 · 362 阅读 · 0 评论 -
Android之BaseAdapter
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-26 21:20:16 · 99 阅读 · 0 评论 -
Android之BaseAdapter
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-26 23:35:42 · 85 阅读 · 0 评论 -
Android之GridView和BaseAdapter
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-27 17:36:05 · 359 阅读 · 0 评论 -
Android之动态改变适配器数据源
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-27 18:22:39 · 1483 阅读 · 0 评论 -
Andrios之spinner的级联应用
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-27 22:34:31 · 113 阅读 · 0 评论 -
android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0原因分析如下:遇到这种情况,很有可能是把一个int型业务数据的 设置setText()或者类似的方法中, 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件ID, 所以就会报出这个bug。 将int型业...转载 2018-07-08 15:53:33 · 518 阅读 · 0 评论 -
Android适配器
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-26 16:49:52 · 91 阅读 · 0 评论 -
Android自定义对话框
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-26 13:06:39 · 96 阅读 · 0 评论 -
Android 进度条
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-25 23:04:55 · 111 阅读 · 0 评论 -
Android 列表单选对话框
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-25 21:51:30 · 1654 阅读 · 0 评论 -
Android 列表多选对话框
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-25 21:47:35 · 2972 阅读 · 0 评论 -
Android实现欢迎界面的自动跳转
Android实现欢迎界面的自动跳转,就是打开某一个安卓手机应用,出现的欢迎界面停留几秒钟,自动进入应用程序的主界面。在网上看到很多种实现办法,但是感觉这种方法还是比较简单的。在onCreate里设置个Timer,然后建立Intent指向你要调用Activity。设置Timer 10妙后执行startActivity就行了。 示例代码:protected void onCreate(Bundle ...转载 2018-06-30 13:48:49 · 2044 阅读 · 0 评论 -
Android 欢迎全屏图片详解及实例代码
Android 欢迎全屏图片详解 其实欢迎界面就是在主Activity之前再添加一个欢迎的Activity。在这个Activity中实现欢迎界面,和其他的Activity用法是基本一样,只有细微的差别。 1、在Activity的onCreate方法中实现:?123456789@Overrideic void onCreate(Bundle savedInstanceState) { supe...转载 2018-06-30 13:38:38 · 481 阅读 · 0 评论 -
Android之DialogFragment
activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:la...原创 2018-06-30 12:09:56 · 130 阅读 · 0 评论 -
Andriod之用Intent实现Activity之间的跳转
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-28 12:25:03 · 197 阅读 · 0 评论 -
Android之隐式启动通过action跳转到指定的Activity
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-28 12:44:26 · 7408 阅读 · 0 评论 -
Android之通过category跳转到指定的Activity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-28 13:36:07 · 372 阅读 · 0 评论 -
解决Android横竖屏切换数据丢失问题的方法
Android横竖屏切换时,当前的Activity会被销毁,然后Activity上面的数据将会全部丢失。如Listview上面每个item的checkbox,横竖屏切换时,复选框就丢失所有选中信息。解决方案1:在Androidmanifest.xml的activity标签中加入android:configChanges="orientation|keyboardHidden"<a...原创 2019-09-17 16:32:14 · 1393 阅读 · 0 评论 -
安卓按home键之后,再次点击程序图标避免再次重新启动程序解决办法
正在运行的android程序,按home键之后退回到桌面,在次点击程序图标避免再次重新启动程序解决办法例如:一个android程序包含两个Activity,分别为MainActivity和OtherActivity,MainActivity为程序启动的Activity。如果程序正位于OtherActivity,点击home键,程序退回到桌面,在次点击程序图标,程序默认会自动重启,即重...转载 2019-07-24 01:15:56 · 953 阅读 · 0 评论 -
Android: Android Studio签名打包的两种方式(zz)
注:给我们自己开发的app签名,就代表着我自己的版权,以后要进行升级,也必须要使用相同的签名才行。签名就代表着自己的身份(即keystore),多个app可以使用同一个签名。如果不知道签名是啥意思,请自行百度哦。在eclipse中签名的方法是:选中工程,邮件选择"export-android-export android application",1、方式1:通过Android Studi...转载 2019-06-08 18:25:22 · 164 阅读 · 0 评论 -
解决设置沉浸式时华为手机底部导航栏兼容性问题
在设置沉浸式时,华为手机底部导航栏会覆盖app的真实内容,提供以下解决方案:判断是否有导航栏并且获取高度,然后给window的content设置paddingpublic static int getNavigationBarHeight(Context context) { boolean hasMenuKey = ViewConfiguration.get(conte...转载 2019-06-13 13:05:39 · 1491 阅读 · 0 评论 -
Android中string转换成int
int -> Stringint i=12345;String s=”“;第一种方法:s=i+”“;第二种方法:s=String.valueOf(i);这两种方法有什么区别呢?作用是不是一样的呢?是不是在任何下都能互换呢?第一种方法:s=i+”“; //会产生两个String对象第二种方法:s=String.valueOf(i); //直接使用String类的静态方...转载 2019-05-18 17:33:20 · 1310 阅读 · 0 评论 -
android学习-头像裁剪和上传
写这篇文章希望能帮助到各位有兴趣的同伴,这个功能一开始是因为公司要实现头像更换功能,虽然我是后端程序员,但是我这颗好学的心啊,真的是按捺不住。所以就自己捣鼓了一下,还好完美实现了。首先是图片的点击事件,实现从相册选择图片和使用相机拍照并对选择和拍照后的图片进行裁剪功能,一下是主要代码:/*** 显示修改图片的对话框*/protected void showChoosePicDia...转载 2019-05-11 23:48:27 · 865 阅读 · 0 评论 -
返回键退出程序与不退出程序应用
今天公司老板突然跟我说客户这有一个需求想要实现一下,就是在使用app时,按返回键时,不退出应用程序,相当于home 键的功能,然后我就将退出程序的功能和不退出程序的功能进行了一个比较在这里。1,首先是第一种:当按一次返回键就退出程序,当再次进入app,应用相当于重新进去;方法就是在 activity中什么都不用重写方法,直接实现所有的功能就可以;2,第二种:当按两次返回键时...转载 2019-05-20 23:46:10 · 961 阅读 · 0 评论 -
【android studio】 the logging tag can be at most 23 characters
今天写代码的时候,突然发现平时用的好好的Log竟然报错,提示信息为:the logging tag can be at most 23 characters,was 27...当前Android studio版本为1.4.1,sdk版本为23,可能是更新版本后,对应的API规范有调整,根据提示的意思Log.e(TAG,message)第二个参数的长度最大不能超过23个字符。之前用eclips...转载 2019-05-08 09:28:14 · 203 阅读 · 0 评论 -
海马玩模拟器无法链接问题处理
昨天搞了半天的电脑总是USB无法链接手机,开发进度要求比较快所以先果断弃坑找个genymotion结果genymotion下载的模拟器告诉我硬件系统不支持,心里顿时奔腾着无数的羊驼,最后还是选择以前比较稳定的海马玩模拟器吧,下面我就说说怎么配置。1.首先我们需要配置adb的环境变量具体步骤计算机点右键->属性->高级系统设置->高级选项卡->环境变量->将...转载 2019-05-09 15:42:44 · 638 阅读 · 0 评论 -
Android 限制EditText仅仅能输入数字、限制输入类型、限制输入长度的小技巧
准确的说让Edittext仅仅能输入数字有方法两种,都是通过xml属性设置方法一: <EditText android:id="@+id/u_account" android:layout_width="0dp" android:layout_height="match_parent" ...转载 2019-05-05 17:48:58 · 617 阅读 · 0 评论 -
LinearLayout中的控件两端对齐 或 Button、TextView左右对齐
在android中的控件LinearLayout 中的android:gravity="center" 属性,要么是居左、居右、居中对齐,不能达到双控件 两端对齐,要实现两端对齐方式,要采用 中间增加一个控件的方式实现 ,并设置属性weight=1。<LinearLayout android:layout_width="match_parent" android:layout_...转载 2018-07-07 22:54:07 · 1672 阅读 · 0 评论 -
android R.layout 中找不到已存在的布局文件
在R.layout.test文件时,总是找不到您想要的文件,可是它明明就在layout文件下面,而且在R.Java中也已经生成了,那么找不到的原因就是你导入了Android.R的包,这样你永远找不到你想要是,你应该导入自己项目的R文件。如图: (你应该导入下面的,但是往往坑爹的android.R在上面!)我最后的解决方法是在代码中加上包名引用:setContentView(com.example....转载 2018-07-07 21:44:53 · 2129 阅读 · 1 评论 -
安卓的多线程,在实际操作中,到底有什么用处
多线程是相对UI主线程而言的。用户操作涉及到处理文件IO,网络IO的耗时操作时,新开线程异步处理的方法能避免UI线程被阻塞,界面才不会无法响应,影响用户体验。android流畅度没有iOS高,不是因为字节码,因为现代java虚拟机有热点探测技术,会把频繁执行的字节码编译成和c一样的机器码。不流畅的原因是java有垃圾回收机制(GC),无论什么类型的GC,总是会有stop the world的停顿。...原创 2018-06-28 18:41:06 · 978 阅读 · 0 评论 -
Android之Intent实现携带参数跳转并返回值
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...原创 2018-06-28 17:53:42 · 7792 阅读 · 1 评论 -
Android之调用联系人
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...原创 2018-06-28 13:53:15 · 224 阅读 · 0 评论 -
Android 列表对话框
package com.example.test9;import android.support.v7.app.ActionBarActivity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.Menu;...原创 2018-06-25 17:57:06 · 1515 阅读 · 0 评论 -
Android之Fragment的替换
fragment_demo.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...原创 2018-06-29 22:25:59 · 1746 阅读 · 0 评论