我有2个课程GLLayer
和GLCamTest
。我正在尝试运行位于GLCamTest
...
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;
}
我正在寻找GLLayer
的帖子,但据我所知,我需要一个处理程序..
public void run() {
GLCamTest cam = new GLCamTest();
image = cam.extractimage(q);
}
我从public void onDrawFrame(GL10 gl) {
内部启动线程我的问题是如何实现所述处理程序?我读过http://developer.android.com/reference/android/os/Handler.html但我仍然不明白我是如何实现它的。有人可以帮帮我吗?
答案 0 :(得分:1)