Brandex07 Brandex07 - 7 months ago 50
Android Question

Trying to use Log.d function from static context in Android

Log.d seems to not be displaying anything in my terminal. Is this related to using a static method?

public static void setPosition(int pos){
DetailActivity.pos = pos;

Log.d("counter", "" + counter);

if(DetailActivity.counter == 1){
if (DetailActivity.mInterstitialAd.isLoaded()) {;
counter = 0;


Log is going to print to LogCat. In Android Studio, go to the Android Monitor tab to see this output.

You may add filters for your tag or message in the search box, for example entering "counter" should show your message.