Advertisement
vedi0boy

SurfaceView

Dec 31st, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public class Anaglyph extends SurfaceView implements SurfaceHolder.Callback{
  2. public Anaglyph(Context context) {
  3. super(context);
  4. getHolder().addCallback(this);
  5. thread = new MainThread(getHolder(), this);
  6. setFocusable(true);
  7. loading_screen = BitmapFactory.decodeResource(getResources(),R.drawable.loading_screen);
  8. }
  9. @Override
  10. public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
  11. }
  12. @Override
  13. public void surfaceCreated(SurfaceHolder arg0) {
  14. thread.setRunning(true);
  15. thread.start();
  16. }
  17. @Override
  18. public void surfaceDestroyed(SurfaceHolder arg0) {
  19. boolean retry = true;
  20. while(retry){
  21. try{
  22. thread.join();
  23. retry=false;
  24. }catch(InterruptedException e){}
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement