SDK Location not found in android studio

A quick note about this if trying to run a Facebook sample and this error pops up, make sure you select the build.gradle file in the root of Facebook sdk, for all the samples when ‘opening an existing project’. I got this error when I tried to open the gradle for just the Scrumptious sample … Read more

How to get text from EditText?

Well, it depends on your needs. Very often I keep my references to widgets in activity (as a class fields) – and set them in onCreate method. I think that is a good ideaProbably the reason for your nulls is that you are trying to call findViewById() before you set contentView() in your onCreate() method – please check that.

How to change spinner text size and text color?

Make a custom XML file for your spinner item. spinner_item.xml: Give your customized color and size to text in this file. Now use this file to show your spinner items like: You don’t need to set the drop down resource. It will take spinner_item.xml only to show your items in spinner.

adb devices return error: protocol fault (no status)

I had the same issue and found the problem: Android Studio. Open the Android Studio menu Tools -> Android and uncheck Enable ADB integration. adb devices should work (you might need adb kill-server first). Then you can re-enable ADB integration in Studio.

Android scale animation on view

Here is a code snip to do exactly that. The ScaleAnimation constructor used here takes 8 args, 4 related to handling the X-scale which we don’t care about (1f, 1f, … Animation.RELATIVE_TO_SELF, 0f, …). The other 4 args are for the Y-scaling we do care about. startScale, endScale – In your case, you’d use 0f, 0.6f. Animation.RELATIVE_TO_SELF, 1f – … Read more

What is android:ems attribute in Edit Text? [duplicate]

Taken from: http://www.w3.org/Style/Examples/007/units: The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font … Read more

Failed to find style ‘coordinatorLayoutStyle’ in current theme

I solved this rendering problem by simply inserting this line into the application theme (the app theme is usually placed in styles.xml). [SDK 28] [SDK 27] As suggested by @Chris. If the IDE does not find the CoordinatorLayout in Widget.Support or Widget.Design, just start typing “CoordinatorLayout” and it should give you some options.

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