我有一个sqlite数据库,其中有一个我想在webview中加载的内容,因为我想从数据库中选择并在 web view 中显示,有什么办法吗?
public class TataworatYawmeeh extends Activity {
WebView webView;
String javascrips;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tataworat);
webView = (WebView) findViewById(R.id.tatworatWebView);
webView.setBackgroundColor(0x00000000);
try {
DataBaseHelper myDbHelper = new DataBaseHelper(this);
myDbHelper = new DataBaseHelper(this);
try {
myDbHelper.createDataBase();
String selectQuery = "SELECT * FROM 'nnn'";
SQLiteDatabase db = myDbHelper.getReadableDatabase();
db.execSQL(selectQuery);
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
try {
myDbHelper.openDataBase();
} catch (SQLException sqle) {
throw sqle;
}
}
}
}