Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why some methods in android studio are marked with a line on it?

Tags:

android

Some methods are marked with a line on it. Is this some kind of error ?? this thing bothers me but the applications work fine.

like image 702
Shubhang Khattar Avatar asked Jul 19 '15 09:07

Shubhang Khattar


People also ask

Why does Android Studio have lines?

That line historically represents the margin of A4 paper, which is useful only if you need to print the code. Old school says that you should keep your code inside that margin, to guarantee much portability.

How do you call a method in Android?

To call a method in Java, you type the method's name, followed by brackets. This code simply prints “Hello world!” to the screen. Therefore, any time we write helloMethod(); in our code, it will show that message to the screen.

What is setContentView?

SetContentView is used to fill the window with the UI provided from layout file incase of setContentView(R. layout. somae_file). Here layoutfile is inflated to view and added to the Activity context(Window).

On which of these tabs do Android errors show up on an Android Studio?

There's "Messages" tab in Android Studio. Complilation errors and warning go there. You can select it by pressing alt+0 (⌘+0 in OS X - a shortcut to View|Tool Windows|Messages).


2 Answers

Deprecated methods. That means that there are newer alternative methods available to be used which are more compatible. Deprecated methods do work, but Google does not guarantee their proper functioning. And support for those methods may be ended in future versions of android.

like image 95
Samrat Dutta Avatar answered Sep 30 '22 09:09

Samrat Dutta


They are deprecated. Consider using ones who aren't.

like image 28
iliyaitsme Avatar answered Sep 30 '22 07:09

iliyaitsme