1
I am making the Example 5 of the cap 3 of the book Google Android 3ºed(Ricardo R.Lecheta), where applying a filter to display on the logcat. only you’re not returning anything to me.
package br.livro.android.cap3;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class Exemplo5 extends Activity {
private static final String CATEGORIA = "livro";
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
// Verbose
Log.v(CATEGORIA, "log de verbose");
// Debug
Log.d(CATEGORIA, "log de debug");
// Info
Log.i(CATEGORIA, "log de info");
// Warn
Log.w(CATEGORIA, "log de alerta");
// Error
Log.e(CATEGORIA, "log de erro", new RuntimeException("teste de erro"));
}
}
I’m without the Eclipse here (using the Android Studio), but you have already tried to run the logcat in hand? (
adb logcat
). Maybe the IDE is redirecting thestdout
or something like that (Official Documentation of Google).– Anthony Accioly
Do as @Anthonyaccioly said to see if it works.
– Jorge B.
using the command (
adb logcat
) returns me some more information than I typed in my class, have to use filter or should appear?– JBarbosa
@Josinaldo when you remove the filter and keep using the emulator, the logs keep appearing?
– Neto Marin
I tested on another project and it worked :), must be some error I made in the application, thanks to all.
– JBarbosa