Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search all files for a string in Android Studio?

In Android Studio (IntelliJ) how do you execute a 'File Search' for a string within a Scope of files? Can Search Everywhere do this, I only see how to use it to search 'code', not 'files'

Example: Search for the string "Dummy Button" in the 'Workspace Scope'.

Expected Response: res/values/string.xml:line4

like image 737
J-Dizzle Avatar asked Sep 12 '15 15:09

J-Dizzle


People also ask

How to search all in Android Studio?

In Android Studio, you can search for all files using the following shortcuts: control + shift + F on Windows and Linux. command + shift + F on Mac.

How to search text in whole project Android Studio?

To search for a string/text in your Android Studio Project just double tap on the Shift key and a search window will appear that will allow you to search for the string occurrence in all the files anywhere in your project i.e. lets you search in projects, class files, as well as settings.

How do I get a list of folders in Android?

File myDirectory = new File("path to some directory"); File[] directories = myDirectory. listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pathname. isDirectory(); } });


3 Answers

You can do it in two ways,

Goto Menu -> Edit -> Find -> Find in Path

enter image description here

Or use the shortcut,

ctrl+shift+f

like image 128
Sajeetharan Avatar answered Oct 17 '22 13:10

Sajeetharan


In Android Studio,

  1. On a Windows or Linux based machine use shortcut Ctrl + Shift + F to search any string in whole project. It's easy to remember considering Ctrl + F is used to search in the current file. So just press the Shift as well.

  2. On OSX use the Command key instead of Ctrl.

  3. Use Ctrl + F combination for Windows and Linux to search in current file.

  4. Use Shift + Shift (Double Tap Shift) combination for Windows and Linux to search Project File of Project.

  5. Command+Shift+F on Mac to find in path

like image 18
Karan sharma Avatar answered Oct 17 '22 12:10

Karan sharma


Try this. Enter your string name in dialogue box after pressing ctrl+shift+f

like image 10
Mohammad Tauqir Avatar answered Oct 17 '22 12:10

Mohammad Tauqir