diff --git a/app.apk b/app.apk
index 957f00c..9d5c34f 100644
Binary files a/app.apk and b/app.apk differ
diff --git a/main/assets/about.htm b/main/assets/about.htm
index 066944e..95677b0 100644
--- a/main/assets/about.htm
+++ b/main/assets/about.htm
@@ -23,7 +23,7 @@ p { text-indent:2em; }
获取网页图标
字符串转Bitmap
更新日志:
-V4.29 (2023-02-22)
- 收藏夹增加分类。
+V4.29 (2023-02-22)
- 收藏夹增加分类。
- 修改导出HTML和CSV方法。
V4.28 (2022-11-07)
- 资源探查脚本支持返回多个对象。
分类标题增加数量。
使用 <details> 代替 <div>,分类可折叠。
V4.27 (2022-10-22)
- 修改收藏夹数据库目录。
- 收藏夹增加分享数据库功能。
V4.26 (2022-07-23)
- 增加页面信息。
- 增加资源探查。
diff --git a/main/java/com/hty/browser/FavoriteActivity.java b/main/java/com/hty/browser/FavoriteActivity.java
index d415c31..e112a70 100644
--- a/main/java/com/hty/browser/FavoriteActivity.java
+++ b/main/java/com/hty/browser/FavoriteActivity.java
@@ -107,7 +107,6 @@ public class FavoriteActivity extends Activity {
}
});
- //search(0, "");
RadioButton radioButton = (RadioButton) radioGroup.getChildAt(0);
radioButton.performClick();
}
@@ -136,8 +135,8 @@ public class FavoriteActivity extends Activity {
public void onClick(DialogInterface dialog, int which) {
String s = editText1.getText().toString();
DBHelper helper = new DBHelper(getApplicationContext());
- Cursor c = helper.category(s);
- if (c.getCount() == 0) {
+ Cursor cursor = helper.category(s);
+ if (cursor.getCount() == 0) {
ContentValues values = new ContentValues();
values.put("category", s);
helper.insert("category", values);
@@ -164,23 +163,31 @@ public class FavoriteActivity extends Activity {
}
break;
case 2:
- String s = "\n\n\n收藏夹\n\n\n\n收藏夹" + adapter.getCount() + "
\n\n标题 | 网址 |
\n";
- for (int i=0; i" + textView_title.getText().toString() + " | " + textView_website.getText().toString() + " | \n";
+ DBHelper helper = new DBHelper(getApplicationContext());
+ Cursor cursor = helper.query("");
+ String s = "\n\n\n收藏夹\n\n\n\n收藏夹" + cursor.getCount() + "
\n\n标题 | 网址 | 分类 |
\n";
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String title = cursor.getString(cursor.getColumnIndex("title"));
+ String website = cursor.getString(cursor.getColumnIndex("website"));
+ String category = cursor.getString(cursor.getColumnIndex("category"));
+ s = s + "" + title + " | " + website + " | " + category + " |
\n";
+ }
}
s += "
\n\n";
writeFile("webfav.htm", s);
break;
case 3:
s = "";
- for (int i=0; i list = new ArrayList<>();
+ list.add("");
+ DBHelper helper = new DBHelper(MainActivity.this);
+ Cursor cursor = helper.category("");
+ if (cursor != null) {
+ while (cursor.moveToNext()) {
+ String s = cursor.getString(cursor.getColumnIndex("category"));
+ list.add(s);
+ }
+ }
+ ArrayAdapter adapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_spinner_item, list);
+ spinner.setAdapter(adapter);
+ layout.addView(spinner);
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
Bitmap icon = list_webView.get(currentPage).getFavicon();
- if(icon == null) icon = BitmapFactory.decodeResource(getResources(), R.drawable.network);
+ if (icon == null)
+ icon = BitmapFactory.decodeResource(getResources(), R.drawable.network);
Matrix matrix = new Matrix();
matrix.postScale((float)100/icon.getWidth(), (float)100/icon.getHeight());
Bitmap bitmap = Bitmap.createBitmap(icon, 0, 0, icon.getWidth(), icon.getHeight(), matrix, true);
@@ -742,6 +758,7 @@ public class MainActivity extends Activity {
ContentValues values = new ContentValues();
values.put("website", surl);
values.put("title", stitle);
+ values.put("category", spinner.getSelectedItem().toString());
helper.insert("webfav", values);
IMM.hideSoftInputFromWindow(ET_title.getWindowToken(), 0);
} else {