title: LibGDX Screen Support Sizes in Android
body: <p>I'm trying to create a game with LibGDX. My problem comes when I put the background in the screen that I have. I created a Base Screen (abstract) in order to make easier. In Desktop, the screen fits good, but in Android, trying different devices, the screen doesn't scale to full screen. I solved this situation using the next easy code:</p>
  
  <pre><code>public void render(float delta) { 
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 
  
      batch.begin(); 
      batch.draw(texture, 0, 0, Gdx.graphics.getWidth(),  Gdx.graphics.getHeight()); 
      batch.end();
  }
  </code></pre>
  
  <p>That was enough to see my game in full screen on android devices. Now, I want to use Scene2D(which I don't know so much...) So I create a Stage, I'm dealing with the background like an actor. Here's my code.</p>
  
  <pre><code>public class MenuScreen extends BaseScreen {
  
  private FitViewport viewport;
  private Stage stage;
  private Image imageFondo, imagePrueba;
  //private float escala;
  
  public MenuScreen(MissingWords missingwords) {
      super(missingwords);
  }
  
  @Override
  public void show() {
      //viewport = new StretchViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      viewport = new FitViewport(800, 480);
      stage = new Stage(viewport, missingwords.getSB()); 
      //Gdx.input.setInputProcessor(stage);
  
      /* Crear fondo */
  
      imageFondo = new Image(missingwords.getAM().get("fondo.png", Texture.class));
      stage.addActor(imageFondo);
  
      imagePrueba = new Image(missingwords.getAM().get("prueba.png", Texture.class));
      imagePrueba.setPosition(50, 50);
      stage.addActor(imagePrueba);
  }
  
  @Override
  public void render(float delta) {
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      stage.act();
      stage.draw();
  }
  
  @Override
  public void resize(int width, int height) {
      stage.getViewport().update(width, height, true);
  
  }
  </code></pre>
  
  <p>However, it doesn't work and I don't know if I'm using the Viewports in the correct way. How can I write this line in order to be compatible with Scene 2D and support android devices?</p>
  
  <pre><code>batch.draw(texture, 0, 0, Gdx.graphics.getWidth(),  Gdx.graphics.getHeight());
  </code></pre>
  
  <p>Thanks in advance. </p>