Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studios doesn't understand Log function

I'm fairly new to android programming in general, and I'm having problems with printing to my log. I'm using Log.v() to do it, but I get an error: "cannot resolve symbol v"

This is the code:

import android.util.Log;
public class DressDatabase {
    Dress[] dresses;
    private static final String TAG = "Testing: ";

    public DressDatabase(){
        dresses = new Dress[15];
    }

    Log.v(TAG, "String");
}
like image 683
user2464083 Avatar asked Jun 07 '13 15:06

user2464083


2 Answers

Try this:

import android.util.Log;
public class DressDatabase {
    Dress[] dresses;
    private static final String TAG = "Testing: ";

    public DressDatabase(){
        dresses = new Dress[15];
        Log.v(TAG, "String");
    }

}
like image 130
TronicZomB Avatar answered Sep 20 '22 17:09

TronicZomB


This is being caused as Log function cannot identify the tag and msg while you type. Once you finished with your instruction, check if the error message still pops up, if so press Alt+Enter. It will resolve. Check out my screenshot.Click here to view my screenshot

like image 38
Sankara Narayanan Avatar answered Sep 16 '22 17:09

Sankara Narayanan