【发布时间】:2015-10-24 12:25:37
【问题描述】:
在我的应用程序中,我正在使用下载 DB sql lite,并且我已将此代码设置为返回终止下载的消息
protected String doInBackground(String... params) {
if(first) {
File dbPath = getDatabasePath(DatabaseHelper.DB_NAME);
if (dbPath.exists()) {
DBProvider provider = new DBProvider(MainActivity.this);
database_comune_dao commune_dao = new database_comune_dao(provider.getDb());
FirstProjectApplication.allComunes.clear();
FirstProjectApplication.allComunes = commune_dao.getAllComune();
}
return "SUCCESS";
}
我想用 Material Design 的新 Snackbar 更改返回消息,这是代码
Snackbar.with(getApplicationContext()) // context
.text("SUCCESS") // text to display
.show(this);
我尝试使用此代码更改返回,但出现错误。 知道如何为此设置此小吃吧吗?
谢谢
【问题讨论】:
-
您能否说明您要达到的目标,发布您尝试失败的代码以及您获得的错误?