Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7766047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:18:58+00:00 2026-06-01T15:18:58+00:00

Ok, I have my android game running smooth but can’t get it to advance

  • 0

Ok, I have my android game running smooth but can’t get it to advance levels.
I also get this warning:
Description Resource Path Location Type
Type safety: The method addElement(Object) belongs to the raw type Vector. References to generic type Vector should be parameterized LevelManager.java/FROZEN BUBBLES/src/org/bigdaddyapp/android/frozenbubbles line 32 Java Problem

import android.os.Bundle;
import java.util.Vector;

public class LevelManager {
private int currentLevel;
private Vector levelList;

public void saveState(Bundle map) {
    map.putInt("LevelManager-currentLevel", currentLevel);
}

public void restoreState(Bundle map) {
    currentLevel = map.getInt("LevelManager-currentLevel");
}

public LevelManager(byte[] levels, int startingLevel) {
    String allLevels = new String(levels);

    currentLevel = startingLevel;
    levelList = new Vector();

    int nextLevel = allLevels.indexOf("\n\n");
    if (nextLevel == -1 && allLevels.trim().length() != 0) {
        nextLevel = allLevels.length();
    }

    while (nextLevel != -1) {
        String currentLevel = allLevels.substring(0, nextLevel).trim();

        levelList.addElement(getLevel(currentLevel));

        allLevels = allLevels.substring(nextLevel).trim();

        if (allLevels.length() == 0) {
            nextLevel = -1;
        } else {
            nextLevel = allLevels.indexOf("\n\n");

            if (nextLevel == -1) {
                nextLevel = allLevels.length();
            }
        }
    }

    if (currentLevel >= levelList.size()) {
        currentLevel = 0;
    }
}

private byte[][] getLevel(String data) {
    byte[][] temp = new byte[8][12];

    for (int j = 0; j < 12; j++) {
        for (int i = 0; i < 8; i++) {
            temp[i][j] = -1;
        }
    }

    int tempX = 0;
    int tempY = 0;

    for (int i = 0; i < data.length(); i++) {
        if (data.charAt(i) >= 48 && data.charAt(i) <= 55) {
            temp[tempX][tempY] = (byte) (data.charAt(i) - 48);
            tempX++;
        } else if (data.charAt(i) == 45) {
            temp[tempX][tempY] = -1;
            tempX++;
        }

        if (tempX == 8) {
            tempY++;

            if (tempY == 12) {
                return temp;
            }

            tempX = tempY % 2;
        }
    }

    return temp;
}

public byte[][] getCurrentLevel() {
    if (currentLevel < levelList.size()) {
        return (byte[][]) levelList.elementAt(currentLevel);
    }

    return null;
}

public void goToNextLevel() {
    currentLevel++;
    if (currentLevel >= levelList.size()) {
        currentLevel = 0;
    }
}

public void goToFirstLevel() {
    currentLevel = 0;
}

public int getLevelIndex() {
    return currentLevel;
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:18:59+00:00Added an answer on June 1, 2026 at 3:18 pm

    For the Eclipse environment you get a warning for not using generics, so you should use

    private Vector<byte[][]> levelList;
    

    instead.

    One alternative is to turn off the warning in the Eclipse preferences, but I don’t recommend that. The warnings are there to help you.

    I’d also recommend you create a class for Level instead of using byte[][].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a game engine in Android, but I don't have much
I have a C++ game running through JNI in Android. The frame rate varies
I am trying to get my game running smoothly on android using PlayN, everything
I am developing an android game. in this i have two moving images on
I have a game running on android. basically, it's structure is like lunarlander I
We have an idea for a game running under Android and I've been playing
I am making an android game that should display a message that you have
I'm building a little Android game using libgdx. For now I have a copy
I'm working on an android game with OpenGL, and I have a game update
I'm creating an Android game and I encountered a problem. I have 2 threads:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.