Yugo Amaryl

Greenhorn
+ Follow
since Apr 21, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yugo Amaryl

Hi,

Google found many similar topics, but either they were unhelpful, or nobody answered the questions.
So, here is my problem. I'm following this tutorial: Android Game Development – Displaying Images with Android

To summarize, the MainActivity has this code:


So, the code above creates a MainGamePanel with a reference to itself as a parameter.
MainGamePanel's constructor launches MainThread with a reference to itself too:



MainGamePanel contains this code:



And MainThread contains this code:



I think the only thing I changed as compared to the tutorial, is that I call "draw(canvas)" instead of "onDraw(canvas)".
As expected, the onDraw method is called automatically (I checked it is actually called, and it is), but nothing is ever drew. The screen remains completely black.

I unsuccessfully tried many tweaks. Among other things I figured it could be useful, in MainGamePanel.onDraw to call:



It didn't change anything though.

Any idea?
Thanks.
10 years ago