June-All

对话框

AlertDialog.Builder builder=new AlertDialog.Builder(MainActivity.this);-----创建对话框管理者

builder.setView(view);------设置布局

AlertDialog dialog=builder1.create();-----创建对话框

dialog.show();-----展示对话框

Menu菜单

系统

onCreateOptionsMenu----activity中重写,加载xml文件-----调用getMenuInflater().inflate(R.menu.menu,menu) 方法 参数为: xml文件和menu

onOptionsItemSelected----activity中重写,内容点击监听

上下文

registerForContextMenu(textView);-------绑定控件

onCreateContextMenu----activity中重写,加载xml文件

onContextItemSelected----activity中重写,内容点击监听

弹出菜单

PopupMenu popupMenu=new PopupMenu(MainActivity.this,text);—参数: 上下文, 指定的控件
inflate-----设置布局
setOnMenuItemClickListener-----设置监听
调用show 方法

PoupWindow

PopupWindow popupWindow = new PopupWindow(Main2Activity.this);
setContentView-----设置布局
setHeight----设置高度
setWidth----设置宽度
setOutsideTouchable----设置点击外部取消
showAsDropDown-----相对控件
showAtLocation----相对父布局

通知

NotificationManager manager= (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);

Notification.Builder builder = new Notification.Builder(this);
builder .setSamllIcon-----设置小图标该属性必须设置
notify(1,builder.build());----刷新通知

存储

SP

SharedPreferences preferences = getSharedPreferences(“songdingxing”, MODE_PRIVATE)

SharedPreferences.Editor editor = preferences.edit();

editor.putString(“loc”,“456”);
editor.commit();

SD

读写权限:android.permission.READ_EXTERNAL_STORAGE
android.permission.WRITE_EXTERNAL_STORAGE

尺寸压缩

BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds=true;//设置只采边框
BitmapFactory.decodeByteArray(data,0,data.length,options);//采样
int outWidth = options.outWidth;//获得原图的宽
int outHeight = options.outHeight;//获得原图的高
//计算缩放比例
int size=1;
while(outWidth/size>100||outHeight/size>100){
size*=2;
}
//TODO 2:第二次采样:按照比例才像素
options.inJustDecodeBounds=false;//设置只采边框为fasle
options.inSampleSize=size;//设置缩放比例
Bitmap bitmap=BitmapFactory.decodeByteArray(data,0,data.length,options);//采样

质量压缩

Bitmap.compress(CompressFormat format, int quality, OutputStream stream)

参数一:Bitmap被压缩成的图片格式
参数二:压缩的质量控制,范围0~100
参数三:输出流

内容提供者

获取短信等等

ContentResolver resolver = getContentResolver();

Uri uri= ContactsContract.CommonDataKinds.Phone.CONTENT_URI;------查询的字段

Cursor cursor=resolver.query(uri,strs,null,null,null);-----查询获取

cursor.moveToNext()----遍历

cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));-----遍历获取数据

权限

联系人

android.permission.READ_CONTACTS-----权限

ContactsContract.CommonDataKinds.Phone.CONTENT_URI -----uri

字段:
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME------姓名

ContactsContract.CommonDataKinds.Phone.NUMBER-------电话

手机短信

android.permission.READ_SMS-----权限

Telephony.Sms.CONTENT_URI-----uri

字段:
Telephony.Sms.ADDRESS ------地址

Telephony.Sms.BODY -------内容

图库

MediaStore.Images.Media.EXTERNAL_CONTENT_URI -----uri

字段:
MediaStore.Images.Media.TITLE ------图片名称

MediaStore.Images.Media.SIZ -------大小

视频

MediaStore.Video.Media.EXTERNAL_CONTENT_URI -----uri

字段:
MediaStore.Video.Media.TITLE -----名称

MediaStore.Video.Media.DATAE -------地址

MediaStore.Video.Media.DURATION----时长

音频

MediaStore.Audio.Media.EXTERNAL_CONTENT_URI-----uri

字段:
MediaStore.Audio.Media.TITLE-----名称

MediaStore.Audio.Media.ARTIST -------歌手

,MediaStore.Audio.Media.DURATION -----总时长

只有第一次调用db时才会调用数据库的onCreate方法只要构造数据库时会调用数据库的构造方法

(hvmunet) root@autodl-container-9d1044903a-6e7f9a3f:~/autodl-tmp/H-vmunet-main# nvidia-smi Wed May 14 13:21:57 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 550.78 Driver Version: 550.78 CUDA Version: 12.4 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 4090 D On | 00000000:38:00.0 Off | Off | | 0% 26C P8 19W / 425W | 1MiB / 24564MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | No running processes found | +-----------------------------------------------------------------------------------------+ (hvmunet) root@autodl-container-9d1044903a-6e7f9a3f:~/autodl-tmp/H-vmunet-main# nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0 (hvmunet) root@autodl-container-9d1044903a-6e7f9a3f:~/autodl-tmp/H-vmunet-main# cat /usr/include/cudnn_version.h /* * Copyright 2017-2022 NVIDIA Corporation. All rights reserved. * * NOTICE TO LICENSEE: * * This source code and/or documentation ("Licensed Deliverables") are * subject to NVIDIA intellectual property rights under U.S. and * international Copyright laws. * * These Licensed Deliverables contained herein is PROPRIETARY and * CONFIDENTIAL to NVIDIA and is being provided under the terms and * conditions of a form of NVIDIA software license agreement by and * between NVIDIA and Licensee ("License Agreement") or electronically * accepted by Licensee. Notwithstanding any terms or conditions to * the contrary in the License Agreement, reproduction or disclosure * of the Licensed Deliverables to any third party without the express * written consent of NVIDIA is prohibited. * * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THESE LICENSED DELIVERABLES. * * U.S. Government End Users. These Licensed Deliverables are a * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT * 1995), consisting of "commercial computer software" and "commercial * computer software documentation" as such terms are used in 48 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government * only as a commercial end item. Consistent with 48 C.F.R.12.212 and * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all * U.S. Government End Users acquire the Licensed Deliverables with * only those rights set forth herein. * * Any use of the Licensed Deliverables in individual and commercial * software must include, in the user documentation and internal * comments to the code, the above Disclaimer and U.S. Government End * Users Notice. */ /** * \file: The master cuDNN version file. */ #ifndef CUDNN_VERSION_H_ #define CUDNN_VERSION_H_ #define CUDNN_MAJOR 8 #define CUDNN_MINOR 6 #define CUDNN_PATCHLEVEL 0 #define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL) /* cannot use constexpr here since this is a C-only file */ /* Below is the max SM version this cuDNN library is aware of and supports natively */ #define CUDNN_MAX_SM_MAJOR_NUMBER 9 #define CUDNN_MAX_SM_MINOR_NUMBER 0 #define CUDNN_MAX_DEVICE_VERSION (CUDNN_MAX_SM_MAJOR_NUMBER * 100) + (CUDNN_MAX_SM_MINOR_NUMBER * 10) #endif /* CUDNN_VERSION_H */是否兼容三者
最新发布
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值