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 trialAndy Hammond
5,415 PointsApp crashing when launched through Android Studio
When I launch Ribbit from android studio, the app unexpectedly crashes. Android studio is not showing any errors in the code or anything. The only thing that shows up in ADB logs is:
"PropertyFetcher: AdbCommandRejectedException getting properties for device 04b0d93c002d306c: device unauthorized. Please check the confirmation dialog on your device."
What does this mean? could this be causing my crashes? I don't want to continue in the course until i figure this out.
So I'm not altogether sure why this was happening, but when I ran my app using debug mode, it pointed out that requestFeature() must be called before adding content.
so, this is what I had:
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// must always set before setContentView
setContentView(R.layout.activity_login);
I believe it was like this in the video, but for some reason this didnt work for me. So I googled it. naturally. Thanks to stackoverflow, i simply put the requestWindowFeature above the super.onCreate(savedInstanceState)
My code now looks like this:
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
// must always set before setContentView
setContentView(R.layout.activity_login);
Hope this helps people with the same issue!
1 Answer
Orit Razon
2,284 PointsThanks!
Haroon Akhtar
3,129 PointsHaroon Akhtar
3,129 Pointsthank you so much. My version was doing the exact same thing and i did not know why, until now :)