Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Romel Liwag
4,183 PointsNo logs in my Logcat help!
[Logcat](file:///C:/Users/rhinemarz07/Desktop/Logcat.PNG"Logcat")
4 Answers
James Simshaw
28,738 PointsTry setting your logcat filter to Verbose which should show anything that came to it.
Romel Liwag
4,183 Pointspackage com.teamtreehouse.funfacts;
import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Random;
public class FunFactsActivity extends ActionBarActivity {
private FactBook mFactBook = new FactBook();
private ColorWheel mColorWheel = new ColorWheel();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fun_facts);
// Declare our View variables and assign the the Views from the layout file
final TextView factLabel = (TextView) findViewById(R.id.factTextView);
final Button showFactButton = (Button) findViewById(R.id.showFactButton);
final RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.relativeLayout);
View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
String fact = mFactBook.getFact();
//update the label with our dynamic fact
factLabel.setText(fact);
int color = mColorWheel.getColor();
relativeLayout.setBackgroundColor(color);
showFactButton.setTextColor(color);
}
};
showFactButton.setOnClickListener(listener);// call the Clicklister
//Toast.makeText(this, "Yay! Our Activity was created!", Toast.LENGTH_LONG).show();
Log.d("FunFactsActivity", "We're logging from the onCreate() method!");
}
}
James Simshaw
28,738 PointsCan you make sure that in Android Studio, Tools, Android, Enable ADB Integration is checked?
Romel Liwag
4,183 PointsThnx! Found the solution in Google, i pressed shift + f9 and it is working now :D now i can continue studying :D
Muhammad Sodikin
2,815 PointsIs on the bottom left of Android Studio. And sometimes it's hide.
Romel Liwag
4,183 PointsRomel Liwag
4,183 PointsThats the thing its empty >.< I saw thing prob wen i started android but now im doing Testing and Debugging, and i dont know wat to do. I tried to post the pic here but i dont know how it doesnt work
James Simshaw
28,738 PointsJames Simshaw
28,738 PointsCould you show your code that you're trying to use to output to logcat?
Romel Liwag
4,183 PointsRomel Liwag
4,183 PointsThe FunFactsActivty from "Build a Simple Android App" i dont have any errors on the code the App is working but the only prob is the logs theres nothing in there its totally empty so i cant filter any logs
James Simshaw
28,738 PointsJames Simshaw
28,738 PointsCan you please copy and paste your code and use markdown so that we can see more details, for example, if there are even any log commands being executed in the code, as well as what level of logging you send that out to if you do have log commands in your code.
Romel Liwag
4,183 PointsRomel Liwag
4,183 Pointsin the Android DDMS it says "No debuggable applications"