J'ai 2 classes GLLayer
et GLCamTest
. Je tente d'exécuter une méthode située dans GLCamTest
...Comment pourrais-je implémenter un gestionnaire ici?
public Bitmap extractimage(int pos){
LocationData tweets;
tweets = new LocationData(this);
SQLiteDatabase db = tweets.getWritableDatabase();
//select the data
String query = "SELECT * FROM tweets;";
Cursor mcursor = db.rawQuery(query, null);
//Move to Position specified.
mcursor.moveToPosition(pos);
//get it as a ByteArray
byte[] imageByteArray=mcursor.getBlob(7);
//the cursor is not needed anymore
mcursor.close();
//convert it back to an image
ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);
Bitmap theImage = BitmapFactory.decodeStream(imageStream);
return theImage;
}
Je suis à la recherche de courir sur un fil de GLLayer
mais de ce que je comprends que je besoin d'un gestionnaire ..
public void run() {
GLCamTest cam = new GLCamTest();
image = cam.extractimage(q);
}
Je commence le fil de l'intérieur public void onDrawFrame(GL10 gl) {
Ma question est de savoir comment j'implémenterais ce gestionnaire? J'ai lu http://developer.android.com/reference/android/os/Handler.html mais je ne comprends toujours pas comment je l'implémenterais. Est-ce que quelqu'un peut m'aider?