显示自数据库在GridView的所有图片
我已存储的存储从图片用文本来在我的数据库中的一些链接,这一点:
I have stored stored some links from pictures with a text to it in my database, with this:
int drawableID = context.getResources().getIdentifier("devil", "drawable", getPackageName());
iv.setImageResource(drawableID);
String info = String.valueOf(drawableID);
mDbHelper.open();
mDbHelper.createSmiley("You received a satanic message", info);
mDbHelper.close();
现在我在我的布局是这样定义的gridview的:
Now I have defined a gridview in my layout like this:
<GridView
android:layout_height="175dp"
android:layout_width="fill_parent"
android:gravity="bottom|right"
android:numColumns="5"
>
</GridView>
现在我想从它们在我的GridView中显示我的数据库导入我的图片和我可以选择其中之一。但我没有得到如何工作的,我怎么能实现呢?这是我的方法导入所有数据库的条目:
Now I want to import my pictures from my database that they are shown in my GridView and that I can select one of them. But I don't get how this works, how I can realize that? This is my method to import all Database entries:
public Cursor getAllSmileys() {
return this.mDb.query(DATABASE_TABLE, new String[] { ROW_ID,
SOURCE, INFO }, null, null, null, null, null);
}
所以我的问题是我怎么能导入所有这些照片到我的GridView向他们展示?另外,我想,用户可以选择其中之一。
So my Question is how I can import all those pictures into my gridview to show them? Also I'd like that the user can select one of them.
勾选此Inserting数据库中的图像,并把它找回来。
有关在数据库中存储的图像,其存储为BLOB和检索回来,并显示它。
For Storing image in Database , store it as BLOB and retrieve it back and show it..
在上面的例子中我展示如何插入图像的数据库和图像视图显示它呢..
In the above example i show how to insert the image in DB and display it it in Image View..
让,如果你发现任何困难我知道..
Let me know if you find any Difficulty..
由于Venky ..
thanks Venky..