Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM

OutOfMemoryError is the most common problem that occurs in android while especially dealing with bitmaps. This error is thrown by the Java Virtual Machine (JVM) when an object cannot be allocated due to lack of memory space and also, the garbage collector cannot free some space. As mentioned by Aleksey, you can add the below … Read more

Android: how to make keyboard enter button say “Search” and handle its click?

In the layout set your input method options to search. <EditText android:imeOptions=”actionSearch” android:inputType=”text” /> In the java add the editor action listener. editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH) { performSearch(); return true; } return false; } });

Change project name on Android Studio

This did the trick for me: Close Android Studio Rename project root directory name Open Android Studio Open the project Clean project If your settings.gradle contains the below line, either delete it or update it to the new name. rootProject.name=”Your project name” Edit: Working in all versions! Last test: Android Studio Chimpmunk Jun 2022.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)