- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 Android 12 适配问题记录
换成 androidx.localbroadcastmanager.content.LocalBroadcastManager,需要导入 androidx.legacy_legacy-support-v4。android-support-v13 包冲突,换成 AndroidX。换成 androidx.core.view.ViewCompat;每个组件都需要添加 “android:exported” 属性。Android.mk 添加。
2023-10-24 09:56:16
427
原创 VSCode 使用问题记录
settings 中搜索“paste”,取消 "Controls whether you can paste content in different way"后粘贴恢复正常。VS Code 使用 Ctrl + V 粘贴,经常卡顿,提示"Running paste handles".
2023-10-23 15:34:06
5074
2
原创 通过蓝牙发送文件到指定设备
/** the intent that is used for initiating a handover transfer */ static final String ACTION_HANDOVER_SEND = "android.nfc.handover.intent.action.HANDOVER_SEND"; /** * 通过蓝牙发送文件 */ private void sendFile(Uri uri) { super.gr...
2022-05-31 17:25:00
727
原创 工作笔记:滥用static标记引发的内存溢出
前天同事问了我一个问题,说替换Android程序中的图片资源会不会引起程序错误。至少我是没有碰到过这种问题。在res/drawable目录下无论是使用jpg、gif还是png格式,都没引发过任何错误。 晚上的时候,同事又将运行错误时的log文本发给我。log上描述的是程序运行到某个draw方法时发生了异常,程序无法分配到足够大的内存。我马上问同事,他替换的图片到底有多大。他告诉我说,是20k。20k这样大小的图片,以前做S40的时候,感觉已经是很奢侈的大小了,但是在 Android平台上,这样的大小算
2011-03-20 10:07:00
1951
2
原创 PendingIntent在AppWidget程序中的应用
<br />1、绑定某一个Widget:<br />updateViews.setOnClickPendingIntent(R.id.next_button, pendingIntent);<br />这里的updateViews是AppWidget的RemoteViews对象<br />2、通过PendingIntent启动一个Activity:<br />格式如下:<br /><br />Intent intent3 = new Intent(context, Activity.class);<br /
2011-03-16 12:37:00
433
原创 Android 天气预报程序
1:获取地理位置LocationManager locationManager;String serviceName = Context.LOCATION_SERVICE;locationManager = (LocationManager) getSystemService(serviceName);Criteria criteria = new Criteria();criteria.setAccuracy(Criteria.ACCURACY_FINE);criteria.setAltitudeRequ
2011-03-16 12:27:00
814
局域网通讯软件源代码
2011-12-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅