您的位置:首页 > 移动开发 > Android开发

70.Android开发知识点总结

2016-07-13 14:31 627 查看
[b]转载:http://blog.csdn.net/worst_hacker/article/details/49867043[/b]

1.android之wifi开发
http://blog.csdn.net/wangkuifeng0118/article/details/7339578

2.Android shape中的padding无效

http://ilgnep.iteye.com/blog/1634139

3.自定义的上下拉刷新和SwipeListView+下拉 http://download.csdn.net/detail/sll110223/8389277
4.String source = "这只是一个测试,测试<u>下划线</u>、<i>斜体字</i>、<font color='red'>红色字</font>的格式";
htmlFormateTextView.setText(Html.fromHtml(source));

http://txlong-onz.iteye.com/blog/1142781
http://www.cnblogs.com/rayray/p/3181922.html

5.(Android4.1版本)以上无法启动支付宝的问题"java.security.spec.InvalidKeySpecException"

http://www.tuicool.com/articles/rYVZzq



6.// 判断是否滚动到底部
boolean scrollEnd = false;
try {
if (view.getPositionForView(mAdapter.getFooterView()) == view
.getLastVisiblePosition())
scrollEnd = true;
} catch (Exception e) {
scrollEnd = false;
}

7.EditText 去除边框
android:background="@null"

8.linearlayout divider设置缩进 设置linearlayout paddingLeft就可以。
计算listview的item高度
int totalHeight = 0;
for (int i = 0; i < mAdapter.getCount(); i++) {
View listItem = mAdapter.getView(i, null, mListView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}

9.Exception raised during rendering: java.lang.System.arraycopy
错误原因:API等级 API 20:Android 4.4w,这是Android官网发布的可穿戴设备的API,它是不支持EditText组件的;
http://blog.csdn.net/ituff/article/details/38896223

paddingStart & paddingEnd 是根据左右对齐方式来起作用的

左对齐时, paddingStart 对应 paddingLeft, paddingEnd 对应 paddingRight

右对齐时, 正好相反

10.EditText
http://blog.csdn.net/deaful/article/details/40653561

11.Android中字体加粗

一、在xml文件中使用android:textStyle=”bold”

二、但是不能将中文设置成粗体,将中文设置成粗体的方法是:
TextView tv = (TextView)findViewById(R.id.TextView01);
TextPaint tp = tv.getPaint();
tp.setFakeBoldText(true);


设置edittext输入框的字体颜色
android:textColorHint="#f00"

12.Android 通过httpclient请求web服务器,并解决用户登录session保持

http://blog.csdn.net/yang_734664103/article/details/22025907

13.使用 MediaStore.Images.Media.getBitmap从Uri中获得bitmap以及其缺陷
http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0826/1665.html

14.拍照和本地图片截图
http://blog.csdn.net/superjunjin/article/details/39525663

15.仅wifi下下载:
1.点击下载的时候判断当前的手机网络状态。
2.注册网络变换广播,或者callback。只有在wifi下才允许下载。

16.清除缓存:
http://www.cnblogs.com/rayray/p/3413673.html

17.侧滑
http://blog.csdn.net/singwhatiwanna/article/details/17515543#comments

18.目录展示
http://asialee900715.iteye.com/blog/1867264
http://down.51cto.com/data/760973

19.listview套listview事件处理
http://my.oschina.net/zhibuji/blog/70892

20.用户反馈:
http://www.umeng.com/component_feedback

21.文字设置下划线
中间加横线
tv.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG );
底部加横线:
tv .getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG );

22.fragment加载布局错误:

http://blog.csdn.net/yaolingrui/article/details/7339913

23.

创建快捷方式:http://www.cnblogs.com/linjiqin/archive/2011/02/28/1967187.html
http://blog.csdn.net/lonely_fireworks/article/details/7964183

24.android.os.NetworkOnMainThreadException

http://www.cnblogs.com/sjrhero/articles/2606833.html

25.头像设置

http://bbs.51cto.com/thread-944949-1.html

26.拍照不清晰问题:

http://892848153.iteye.com/blog/1851869
//这样得到的是缩略图
System.out.println(data.getData() + "");
if (data.hasExtra("data")) {
Bitmap bitmap = data.getParcelableExtra("data");
mUri = Uri.parse(MediaStore.Images.Media.insertImage(
getContentResolver(), bitmap, null, null));
crop(mUri);
}

27.横竖屏切换生命周期:

1、不设置Activity的Android:configChanges时,切屏会重新调用各个生命周期,切横屏时会执行一次,切竖屏时会执行两次

2、设置Activity的android:configChanges="orientation"时,切屏还是会重新调用各个生命周期,切横、竖屏时只会执行一次

3、设置Activity的android:configChanges="orientation|keyboardHidden"时,切屏不会重新调用各个生命周期,只会执行onConfigurationChanged方法

button设置下划线

http://blog.csdn.net/lixiaodaoaaa/article/details/42737307

28.透明度值:

http://blog.csdn.net/sky1203850702/article/details/44916819

100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
50% — 80
45% — 73
40% — 66
35% — 59
30% — 4D
25% — 40
20% — 33
15% — 26
10% — 1A
5% — 0D
0% — 00

29.屏幕适配

http://blog.csdn.net/findsafety/article/details/9129831
http://blog.csdn.net/zhaokaiqiang1992/article/details/45419023#使用自动拉伸位图

30.ImageLoader

http://www.cnblogs.com/kissazi2/p/3931400.html

31. The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged!
http://blog.csdn.net/icewst/article/details/41009281

32.最大bug 点击目录播放视频然后立即返回出错
http://www.cnblogs.com/gisdream/archive/2013/07/08/3177432.html

33.Android实现不重复启动APP的方法

http://blog.sina.com.cn/s/blog_5de73d0b0102vpai.html
http://blog.sina.com.cn/s/blog_95c607dd0102w3ro.html

34.搜索后隐藏键盘

http://www.umindex.com/devices/android_os

35.xutis5.0 bug修复

http://blog.csdn.net/pengjinli2011/article/details/44992781

36.android.view.WindowManager$BadTokenException: Unable to add window — token null
http://aijiawang-126-com.iteye.com/blog/662336

37.android.view.WindowLeaked 的解决方案

http://blog.csdn.net/limingchuan123456789/article/details/7850052

38.防止过快点击造成多次事件

http://www.2cto.com/kf/201503/383912.html

39.微信支付
在安装了应用的手机上运行微信获取签名的应用程序
问题找到了,是我们在微信平台注册应用的时候应用签名没有填写对,相当于是keystore没有通过验证,

40.天气api
http://blog.csdn.net/michael_yy/article/details/9768049

41. Unable to add window -- token android.os.BinderProxy@425712c0 is not valid; is your activity running
http://cache.baiducontent.com/c?http://stackoverflow.com/questions/9529504/unable-to-add-window-token-android-os-binderproxy-is-not-valid-is-your-activ

42:有的手机默认不可以使用使用DownloadManager
http://stackoverflow.com/questions/21551538/how-to-enable-android-download-manager#

43.DownloadManager的使用
http://www.trinea.cn/android/android-downloadmanager/

44.Android点击Notification之后回到当前正在运行的Activity
http://www.eoeandroid.com/thread-162446-1-1.html?_dsign=92dfce6d

45极光推送 富文本
http://docs.jpush.cn/pages/viewpage.action?pageId=7536748

46 app打开,安装新包,打开,按home键 再打开app
http://blog.csdn.net/love100628/article/details/43238135
http://blog.csdn.net/andyhuabing/article/details/13997577

47.动态修改View的属性
http://blog.csdn.net/liranke/article/details/45198711

48.webview js代码调用Java代码
http://blog.csdn.net/zgjxwl/article/details/9627685

49.
使用ScrollView或ListView或PullToRefreshListView时,在魅族flyme OS上或中兴手机上会出现上下回弹效果,影响用户体验。

想去除这个回弹效果,只需要在对应控件的xml里配置一个属性即可。

android:overScrollMode="never"

50 Android ListView 单条刷新方法实践及原理解析
http://www.open-open.com/lib/view/open1422425890986.html

51.滑动ViewPager引起swiperefreshlayout刷新的冲突
http://www.tuicool.com/articles/u2iQZjj

52.android全局异常处理

http://www.stormzhang.com/android/2013/02/03/android-catch-global-exception/

53.gradle DSL method not found: useLibrary()

http://segmentfault.com/q/1010000003694725

53: APP字体大小,不随系统的字体大小变化而变化的方法

http://blog.csdn.net/muzitest/article/details/41804369

54:Context的应用场景

http://blog.csdn.net/lmj623565791/article/details/40481055



数字1:启动Activity在这些类中是可以的,但是需要创建一个新的task。一般情况不推荐。

数字2:在这些类中去layout inflate是合法的,但是会使用系统默认的主题样式,如果你自定义了某些样式可能不会被使用。

数字3:在receiver为null时允许,在4.2或以上的版本中,用于获取黏性广播的当前值。(可以无视)

注:ContentProvider、BroadcastReceiver之所以在上述表格中,是因为在其内部方法中都有一个context用于使用。

55.ListView和RadioButton的结合

http://blog.csdn.net/checkin001/article/details/11519131

56.ListView和RadioButton结合

private int mCheckedPosition = -1;

mHolder.couponRBChecked.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
//重置,确保最多只有一项被选中,并且因为setChecked方法会触发onCheckedChanged的调用,所以只有在b为true,即RadioButton被选中的情况下才更新列表
if(b) {
mCheckedPosition = position;
notifyDataSetChanged();
}
}
});
mHolder.couponRBChecked.setChecked(mCheckedPosition == position);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: