我正在学习Android.我有一个问题,我无法解决它.我想从现有数据库中检索数据并TextView在单击后按钮中显示它.
我的代码DataBaseHelper看起来像这样:
public class DataBaseHelper extends SQLiteOpenHelper {
//The Android's default system path of your application database.
private static String DB_PATH = "/data/data/in.ekonomia.android/databases/";
private static String DB_NAME = "cytaty";
private SQLiteDatabase myDataBase;
private final Context myContext;
/** * Constructor * Takes and keeps a reference of the passed context in order to access to the application assets and resources. * @param context */
public DataBaseHelper(Context context)
{
super(context, DB_NAME, null, 1);
this.myContext = context;
}
/** …Run Code Online (Sandbox Code Playgroud) 我制作动态壁纸,我有一个问题.我想将图像设置为背景,Eclipse显示错误:
01-10 10:37:18.206: E/AndroidRuntime(1045): FATAL EXCEPTION: GLThread 99
01-10 10:37:18.206: E/AndroidRuntime(1045): com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be powers of two: 480x800
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像:
public class Tapeta implements ApplicationListener {
private SpriteBatch batch;
private Texture texture;
private TextureRegion region;
@Override
public void create() {
texture = new Texture(Gdx.files.internal("data/cat.jpg"));
Texture.setEnforcePotImages(false);
}
@Override
public void dispose() {
texture.dispose();
}
@Override
public void render() {
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(texture, 0, 0);
batch.end();
}
@Override
public void resize(int width, int height) {
}
@Override
public void …Run Code Online (Sandbox Code Playgroud)