Helpful Information
 
 
Category: Android Development
Some few doubts - Android Game

Hey everyone!

I got several doubts with me and it would be nice that if someone knew how to help in one of them or them all (:P) to do so :D
I'm making an Android Game as my last project before i enter university. Everything I've made was learnt in books and in tutorials.
So, the problems are:

1 - Imagine 4 activities. A, B, C and D. By the activity B, C or D, clicking on the "Exit Game" button, to close all the activities. I used already super.finish() method, super.onDestroy, system.exit(0). None of them worked. Only deleted that activity but went to the back one. EX: Going through activity C to B.
I've heard intent.setFlags(intent.FLAG_ACTIVITY_CLEAR_TOP) method but I don't know where to put it.

2 - Now imagine a car in a track. That track is a .jpg with something like 1900x2000 resolution. I'd like to create some kind of walls around that track that won't let my car escape. When the car passes the image, it just disapears... I heard about the "DisplayMetric class" but I don't know how to use it either. Do you know a better one? I can t even find examples of this class!

3 - I think this is the most simple one. I'd like to call audio. Any .mp3 that i call, that plays when i press Back or Next button.

Ok, that's it! If someone knows one of these problems please, say something, it's urgent!

Thanks :D










privacy (GDPR)