什么是“安全删除"?在Android Studio中? [英] What is a "Safe Delete" in Android studio?

查看:99
本文介绍了什么是“安全删除"?在Android Studio中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想删除一个类或布局时,会弹出一个对话框,问我是否要安全删除"它.

When I want to delete a class or a layout, I get a popup asking me do I want to "Safe Delete" it.

我想知道所有这些选项到底是什么,但是我找不到任何好的答案.

I wanted to know what exactly are all of the options, but i cannot find any nice answers out there.

这三个选项的确切含义是什么?

So what do all of these three options mean exactly?

推荐答案

使用安全删除功能,Android Studio会搜索您的"WebViewA"是否在另一个文件中使用,因此删除它不会导致任何错误.

With safe delete Android Studio will search if your "WebViewA" is used in another file or not, so it won't cause any error if you delete it.

例如,如果您在MyActivity类中使用WebViewA类,然后在不安全删除的情况下删除WebViewA类,则MyActivity类中将出现新错误.

For example if you are using class WebViewA in MyActivity class and then you delete the WebViewA class without safe delete, there will be a new error in MyActivity class.

这是安全删除的示例:

我尝试删除BluetoothUtility类,并使用安全删除,然后Android Studio检测到BluetoothUtility有2种用法

I tried to delete BluetoothUtility class and I used safe delete and then Android studio detect there are 2 usages of BluetoothUtility

选择查看用法"后,我发现我在MyActivity类中使用了BluetoothUtility.而且我也可以根据它进行重构.

After selecting View Usages I can find that I used BluetoothUtility in MyActivity class. And I can also do refactor from it.

我希望我的解释足够清楚!:)

I hope my explanation is clear enough! :)

这篇关于什么是“安全删除"?在Android Studio中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆