![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
异常处理
下沉的代码
量变一定会引起质变,千里之行,始于足下。
展开
-
Android 后台线程弹对话框导致程序崩溃(is not valid; is your activity running)
异常:android.view.WindowManager$BadTokenException: Unable to add window — token android.os.BinderProxy@438e7108 is not valid; is your activity running? 因为使用了AsyncTask 异步线程在线程完成以后的onPostExecute方法里转载 2015-12-14 17:06:20 · 2416 阅读 · 0 评论 -
requestWindowFeature()隐藏标题栏无效
requestWindowFeature(Window.FEATURE_NO_TITLE); 隐藏标题栏,该语句需要在setContentView()方法前被执行,但是在测试时,发现该功能没有起作用。 代码如下: public class FirstActivity extends ActionBarActivity { @Override protected v转载 2016-06-23 22:22:25 · 360 阅读 · 0 评论 -
android中创建水平和竖直虚线。
stack-overflow中的解决方法 自定义view的方式并没有显示虚线,仍需改进。转载 2016-03-23 10:57:49 · 445 阅读 · 0 评论 -
appcompat-v7 版本造成的问题No resource found that matches the given name 'android:TextAppearance.Material.W
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. Error:(2) Error retrieving parent for item: No resour原创 2016-03-23 10:46:19 · 2806 阅读 · 0 评论 -
ImgeView通过加载布局,addview宽高无效问题
一个关于 imageView 设置 scaleType 的问题。 就在刚才 晚上9 点多的时候,我的一个外包伙伴发一个工程代码我,叫我去看下这样一个"bug",说折腾了很久,图片选择器在选择完图片后,就要显示图片到界面上,大家可以想象下 微信 发表图片,因为我们相机的图片肯定是 长宽都不一致的,为了统一格式,一般都是把要显示出来的 imageView 设置成 scaleType = cent转载 2016-02-15 18:11:17 · 3948 阅读 · 1 评论 -
Android 自定义Toolbar/ActionBar视图左边有空白
最近自定义Toolbar之后,发现左侧不能完全填充,总是留一点空白,经过查看新发布的V7的支持包中的style发现了解决方法。 查看Wiget.AppCompat.Toolbar的parent,如下: ? 1 2 3 4 5 6 7 8 9 10 style name="Base.Widget.AppCompat.To转载 2016-01-09 15:38:14 · 785 阅读 · 0 评论 -
Error when inflating android.support.design.widget.TextInputLayout
起因: 今天使用android design support lib,写个使用textinputlayout的小demo,在画完布局之后一直报错 Error when inflating android.support.design.widget.TextInputLayout ,一直找不到原因,最后百度得知: I've encountered the same problem.原创 2015-12-17 16:10:39 · 3812 阅读 · 0 评论 -
You need to use a Theme.AppCompat theme (or descendant) with this activity.
错误描述为: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 起因: 我想在Manifest中设置我的activity全屏,代码如下: [html] view plaincopy activity转载 2015-12-17 16:06:23 · 495 阅读 · 0 评论 -
dialog中帧动画只显示一帧的问题
做了个简单的帧动画,在onCreate方法中start,发现只能看到第一帧 Xml代码 xml version="1.0" encoding="utf-8"?> animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" >转载 2015-12-30 16:01:11 · 381 阅读 · 0 评论 -
toolbar左边留有空白、toolbar两端空白、toolbar两端不能填满布局问题
最近自定义Toolbar之后,发现左侧不能完全填充,总是留一点空白,经过查看新发布的V7的支持包中的style发现了解决方法。 查看Wiget.AppCompat.Toolbar的parent,如下: @style/TextAppearance.Widget.AppCompat.Toolbar.Title @style/TextAppearance.Widg转载 2016-06-24 11:28:03 · 2460 阅读 · 0 评论