收藏夹测试ExpandableListView控件
This commit is contained in:
parent
489f00f4a3
commit
c962451642
|
@ -1,8 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.hty.browser"
|
package="com.hty.browser"
|
||||||
android:versionCode="4"
|
android:versionCode="4"
|
||||||
android:versionName="4.29">
|
android:versionName="4.30">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 查询网络状态权限 -->
|
||||||
|
<uses-permission android:name="andorid.permission.CHANGE_CONFIGURATION" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
|
<!-- GPS权限 -->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_GPS" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
|
@ -10,58 +25,52 @@
|
||||||
android:theme="@android:style/Theme.Holo.Light">
|
android:theme="@android:style/Theme.Holo.Light">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
|
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
android:launchMode="singleInstance">
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleInstance"
|
||||||
|
android:theme="@android:style/Theme.Holo.Light.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:scheme="file"/>
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="content"/>
|
|
||||||
<data android:scheme="https"/>
|
<data android:scheme="file" />
|
||||||
<data android:scheme="http"/>
|
<data android:scheme="content" />
|
||||||
<data android:mimeType="*/*"/>
|
<data android:scheme="https" />
|
||||||
<data android:host="*"/>
|
<data android:scheme="http" />
|
||||||
|
<data android:mimeType="*/*" />
|
||||||
|
<data android:host="*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.WEB_SEARCH"/>
|
<action android:name="android.intent.action.WEB_SEARCH" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND"/>
|
<action android:name="android.intent.action.SEND" />
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="*/*"/>
|
<data android:mimeType="*/*" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".FavoriteActivity"
|
android:name=".FavoriteActivity"
|
||||||
android:icon="@android:drawable/btn_star_big_on"
|
android:icon="@android:drawable/btn_star_big_on"
|
||||||
android:label="收藏夹"
|
android:label="收藏夹"
|
||||||
android:parentActivityName=".MainActivity"/>
|
android:parentActivityName=".MainActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SettingsActivity"
|
android:name=".FavoriteActivity1"
|
||||||
|
android:icon="@android:drawable/btn_star_big_on"
|
||||||
|
android:label="收藏夹"
|
||||||
|
android:parentActivityName=".MainActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".SettingsActivity"
|
||||||
android:icon="@android:drawable/ic_menu_preferences"
|
android:icon="@android:drawable/ic_menu_preferences"
|
||||||
android:label="设置"
|
android:label="设置"
|
||||||
android:parentActivityName=".MainActivity"/>
|
android:parentActivityName=".MainActivity" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
<!-- 查询网络状态权限 -->
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
|
||||||
<uses-permission android:name="andorid.permission.CHANGE_CONFIGURATION"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
<!-- GPS权限 -->
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_GPS" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -9,7 +9,7 @@ p { text-indent:2em; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.29</h2>
|
<h2 align=center><img src=logo.png><br>海天鹰浏览器 V4.30</h2>
|
||||||
<p>内置扩展的浏览器。</p>
|
<p>内置扩展的浏览器。</p>
|
||||||
<p>扩展:链接关键字过滤,链接关键字高亮,图片自定义过滤,视频独立播放。</p>
|
<p>扩展:链接关键字过滤,链接关键字高亮,图片自定义过滤,视频独立播放。</p>
|
||||||
<p>作者:海天鹰</p>
|
<p>作者:海天鹰</p>
|
||||||
|
@ -23,6 +23,7 @@ p { text-indent:2em; }
|
||||||
<p><a href="https://stackoverflow.com/questions/3462582/display-the-android-webviews-favicon" target="_blank">获取网页图标</a></p>
|
<p><a href="https://stackoverflow.com/questions/3462582/display-the-android-webviews-favicon" target="_blank">获取网页图标</a></p>
|
||||||
<p><a href="https://www.jianshu.com/p/c9a18050a249" target="_blank">字符串转Bitmap</a></p>
|
<p><a href="https://www.jianshu.com/p/c9a18050a249" target="_blank">字符串转Bitmap</a></p>
|
||||||
<h3>更新日志:</h3>
|
<h3>更新日志:</h3>
|
||||||
|
<h3>V4.30 (2023-03-23)</h3><ol><li>收藏夹测试 ExpandableListView 控件</li></ol>
|
||||||
<h3>V4.29 (2023-03-01)</h3><ol><li>收藏夹增加分类。</li><li>收藏夹分类的修改和删除。</li><li>修改导出HTML和CSV方法。</li><li>新建收藏和修改收藏编辑框设置最大行数,避免窗口撑大不完整。</li></ol>
|
<h3>V4.29 (2023-03-01)</h3><ol><li>收藏夹增加分类。</li><li>收藏夹分类的修改和删除。</li><li>修改导出HTML和CSV方法。</li><li>新建收藏和修改收藏编辑框设置最大行数,避免窗口撑大不完整。</li></ol>
|
||||||
<h3>V4.28 (2022-11-07)</h3><ol><li>资源探查脚本支持返回多个对象。<br>分类标题增加数量。<br>使用 <details> 代替 <div>,分类可折叠。</li></ol>
|
<h3>V4.28 (2022-11-07)</h3><ol><li>资源探查脚本支持返回多个对象。<br>分类标题增加数量。<br>使用 <details> 代替 <div>,分类可折叠。</li></ol>
|
||||||
<h3>V4.27 (2022-10-22)</h3><ol><li>修改收藏夹数据库目录。</li><li>收藏夹增加分享数据库功能。</li></ol>
|
<h3>V4.27 (2022-10-22)</h3><ol><li>修改收藏夹数据库目录。</li><li>收藏夹增加分享数据库功能。</li></ol>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import android.database.sqlite.SQLiteOpenHelper;
|
||||||
public class DBHelper extends SQLiteOpenHelper {
|
public class DBHelper extends SQLiteOpenHelper {
|
||||||
public static final String filename = "webfav.db";
|
public static final String filename = "webfav.db";
|
||||||
public static final String DATABASE_NAME = MainActivity.dir + File.separator + filename;
|
public static final String DATABASE_NAME = MainActivity.dir + File.separator + filename;
|
||||||
private final static int VERSION = 3;
|
private final static int VERSION = 4;
|
||||||
static String TableName = "webfav";
|
static String TableName = "webfav";
|
||||||
private SQLiteDatabase db;
|
private SQLiteDatabase db;
|
||||||
private static DBHelper mInstance = null;
|
private static DBHelper mInstance = null;
|
||||||
|
@ -32,23 +32,32 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
db.execSQL("CREATE TABLE webfav (_id INTEGER PRIMARY KEY , website TEXT, title TEXT, category TEXT)");
|
db.execSQL("CREATE TABLE webfav (_id INTEGER PRIMARY KEY , website TEXT, title TEXT, category TEXT)");
|
||||||
db.execSQL("CREATE TABLE category (_id INTEGER PRIMARY KEY , category TEXT)");
|
db.execSQL("CREATE TABLE category (_id INTEGER PRIMARY KEY , category TEXT)");
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put("category", "");
|
||||||
|
db.insert("category", null, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
switch (newVersion) {
|
switch (newVersion) {
|
||||||
case 3:
|
case 3:
|
||||||
db.execSQL("CREATE TABLE category (_id INTEGER PRIMARY KEY , category TEXT)");
|
db.execSQL("CREATE TABLE category (_id INTEGER PRIMARY KEY , category TEXT)");
|
||||||
String sql = "ALTER TABLE " + TableName + " ADD COLUMN category TEXT default ''";
|
String sql = "ALTER TABLE " + TableName + " ADD COLUMN category TEXT default ''";
|
||||||
db.execSQL(sql);
|
db.execSQL(sql);
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put("category", "");
|
||||||
|
db.insert("category", null, values);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insert(String tableName, ContentValues values) {
|
public long insert(String tableName, ContentValues values) {
|
||||||
db = getWritableDatabase();
|
db = getWritableDatabase();
|
||||||
db.insert(tableName, null, values);
|
long i = db.insert(tableName, null, values);
|
||||||
db.close();
|
db.close();
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cursor query(String s) {
|
public Cursor query(String s) {
|
||||||
|
@ -62,34 +71,29 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cursor queryCategoty(String s) {
|
public Cursor queryCategory(String s) {
|
||||||
db = getWritableDatabase();
|
db = getWritableDatabase();
|
||||||
Cursor c;
|
Cursor c = db.query(TableName, null, "category = '" + s + "'", null, null, null, "_id desc");
|
||||||
if (s.equals("无分类")) {
|
return c;
|
||||||
c = db.query(TableName, null, "category = ''", null, null, null, "_id desc");
|
}
|
||||||
} else {
|
|
||||||
c = db.query(TableName, null, "category = '" + s + "'", null, null, null, "_id desc");
|
public Cursor category() {
|
||||||
}
|
db = getWritableDatabase();
|
||||||
|
Cursor c = db.query("category", null, null, null, null, null, "category asc");
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cursor category(String s) {
|
public Cursor category(String s) {
|
||||||
db = getWritableDatabase();
|
db = getWritableDatabase();
|
||||||
Cursor c;
|
Cursor c = db.query("category", null, "category = '" + s + "'", null, null, null, null);
|
||||||
if (s.equals("")) {
|
|
||||||
c = db.query("category", null, null, null, null, null, "category asc");
|
|
||||||
} else {
|
|
||||||
c = db.query("category", null, "category = '" + s + "'", null, null, null, null);
|
|
||||||
}
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void del(int id) {
|
public int del(int id) {
|
||||||
if (db == null)
|
if (db == null)
|
||||||
db = getWritableDatabase();
|
db = getWritableDatabase();
|
||||||
db.delete(TableName, "_id=?", new String[] { String.valueOf(id) });
|
int i = db.delete(TableName, "_id=?", new String[] { String.valueOf(id) });
|
||||||
// Log.e("id", id + "");
|
return i;
|
||||||
// db.ExecuteNonQuery(CommandType.Text, "VACUUM");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class FavoriteActivity extends Activity {
|
||||||
if (radioButton == null)
|
if (radioButton == null)
|
||||||
break;
|
break;
|
||||||
final String title = radioButton.getText().toString();
|
final String title = radioButton.getText().toString();
|
||||||
if (title.equals("无分类"))
|
if (title.equals(""))
|
||||||
break;
|
break;
|
||||||
builder.setTitle(title);
|
builder.setTitle(title);
|
||||||
final EditText editText_rename = new EditText(FavoriteActivity.this);
|
final EditText editText_rename = new EditText(FavoriteActivity.this);
|
||||||
|
@ -291,9 +291,8 @@ public class FavoriteActivity extends Activity {
|
||||||
layout.addView(editText_url);
|
layout.addView(editText_url);
|
||||||
final Spinner spinner = new Spinner(this);
|
final Spinner spinner = new Spinner(this);
|
||||||
ArrayList<String> list = new ArrayList<>();
|
ArrayList<String> list = new ArrayList<>();
|
||||||
list.add("");
|
|
||||||
DBHelper helper = new DBHelper(this);
|
DBHelper helper = new DBHelper(this);
|
||||||
Cursor cursor = helper.category("");
|
Cursor cursor = helper.category();
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String s = cursor.getString(cursor.getColumnIndex("category"));
|
String s = cursor.getString(cursor.getColumnIndex("category"));
|
||||||
|
@ -327,19 +326,21 @@ public class FavoriteActivity extends Activity {
|
||||||
values.put("website", surl);
|
values.put("website", surl);
|
||||||
values.put("title", stitle);
|
values.put("title", stitle);
|
||||||
values.put("category", spinner.getSelectedItem().toString());
|
values.put("category", spinner.getSelectedItem().toString());
|
||||||
db.update(DBHelper.TableName, values, "_id = " + sid, null);
|
int i = db.update(DBHelper.TableName, values, "_id = " + sid, null);
|
||||||
IMM.hideSoftInputFromWindow(editText_title.getWindowToken(), 0);
|
if (i != -1) {
|
||||||
RadioButton radioButton = (RadioButton) findViewById(radioGroup.getCheckedRadioButtonId());
|
IMM.hideSoftInputFromWindow(editText_title.getWindowToken(), 0);
|
||||||
if (radioButton == null)
|
RadioButton radioButton = (RadioButton) findViewById(radioGroup.getCheckedRadioButtonId());
|
||||||
search(0, editText.getText().toString());
|
if (radioButton == null)
|
||||||
else
|
search(0, editText.getText().toString());
|
||||||
search(1, radioButton.getText().toString());
|
else
|
||||||
try {
|
search(1, radioButton.getText().toString());
|
||||||
//关闭
|
try { //关闭
|
||||||
field.set(dialog, true);
|
field.set(dialog, true);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
Toast.makeText(getApplicationContext(), "修改失败", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
if (stitle.equals("")){
|
if (stitle.equals("")){
|
||||||
editText_title.setError("标题不能为空!");
|
editText_title.setError("标题不能为空!");
|
||||||
|
@ -380,8 +381,11 @@ public class FavoriteActivity extends Activity {
|
||||||
position = listView.getFirstVisiblePosition();
|
position = listView.getFirstVisiblePosition();
|
||||||
int id = Integer.parseInt(((TextView) menuInfo.targetView.findViewById(R.id.id)).getText().toString());
|
int id = Integer.parseInt(((TextView) menuInfo.targetView.findViewById(R.id.id)).getText().toString());
|
||||||
helper = new DBHelper(getApplicationContext());
|
helper = new DBHelper(getApplicationContext());
|
||||||
helper.del(id);
|
int i = helper.del(id);
|
||||||
search(0, editText.getText().toString());
|
if (i != -1)
|
||||||
|
search(0, editText.getText().toString());
|
||||||
|
else
|
||||||
|
Toast.makeText(getApplicationContext(), "删除失败", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -414,7 +418,7 @@ public class FavoriteActivity extends Activity {
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
cursor1 = helper.query(s);
|
cursor1 = helper.query(s);
|
||||||
} else if (type == 1) {
|
} else if (type == 1) {
|
||||||
cursor1 = helper.queryCategoty(s);
|
cursor1 = helper.queryCategory(s);
|
||||||
}
|
}
|
||||||
int count = cursor1.getCount();
|
int count = cursor1.getCount();
|
||||||
setTitle("收藏夹 - " + s + " " + count);
|
setTitle("收藏夹 - " + s + " " + count);
|
||||||
|
@ -449,15 +453,11 @@ public class FavoriteActivity extends Activity {
|
||||||
IMM.hideSoftInputFromWindow(editText.getWindowToken(), 0);
|
IMM.hideSoftInputFromWindow(editText.getWindowToken(), 0);
|
||||||
radioGroup.removeAllViews();
|
radioGroup.removeAllViews();
|
||||||
DBHelper helper = new DBHelper(this);
|
DBHelper helper = new DBHelper(this);
|
||||||
Cursor cursor = helper.category("");
|
Cursor cursor = helper.category();
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
RadioButton radioButton = new RadioButton(this);
|
|
||||||
radioButton.setText("无分类");
|
|
||||||
radioButton.setOnClickListener(new RadioButtonOnClickListener());
|
|
||||||
radioGroup.addView(radioButton);
|
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String s = cursor.getString(cursor.getColumnIndex("category"));
|
String s = cursor.getString(cursor.getColumnIndex("category"));
|
||||||
radioButton = new RadioButton(this);
|
RadioButton radioButton = new RadioButton(this);
|
||||||
radioButton.setText(s);
|
radioButton.setText(s);
|
||||||
radioButton.setOnClickListener(new RadioButtonOnClickListener());
|
radioButton.setOnClickListener(new RadioButtonOnClickListener());
|
||||||
radioGroup.addView(radioButton);
|
radioGroup.addView(radioButton);
|
||||||
|
@ -496,7 +496,7 @@ public class FavoriteActivity extends Activity {
|
||||||
}
|
}
|
||||||
BW.write(s);
|
BW.write(s);
|
||||||
BW.flush();
|
BW.flush();
|
||||||
Toast.makeText(FavoriteActivity.this, "写文件 " + MainActivity.dir + File.separator + filename + " 成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "写文件 " + MainActivity.dir + File.separator + filename + " 成功", Toast.LENGTH_SHORT).show();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(Thread.currentThread().getStackTrace()[2] + "", e.toString());
|
Log.e(Thread.currentThread().getStackTrace()[2] + "", e.toString());
|
||||||
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
|
|
@ -673,7 +673,7 @@ public class MainActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MenuDialog() {
|
private void MenuDialog() {
|
||||||
String[] items = { "新建窗口", "关闭当前窗口", "收藏当前页", "收藏夹", "查找", "分享", "网页信息", "视频独立播放", "视频截图", "视频在播放器中打开", "资源探查", "查看源码", "保存", "全屏", "广告过滤规则", "清除当前页面缓存", "设置", "检查更新", "关于", "退出" };
|
String[] items = { "新建窗口", "关闭当前窗口", "收藏当前页", "收藏夹", "查找", "分享", "网页信息", "视频独立播放", "视频截图", "视频在播放器中打开", "资源探查", "查看源码", "保存", "全屏", "广告过滤规则", "清除当前页面缓存", "设置", "检查更新", "关于", "退出", "ExpandableListView" };
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle("菜单");
|
builder.setTitle("菜单");
|
||||||
//builder.setIcon(android.R.drawable.ic_menu_preferences);
|
//builder.setIcon(android.R.drawable.ic_menu_preferences);
|
||||||
|
@ -719,7 +719,7 @@ public class MainActivity extends Activity {
|
||||||
ArrayList<String> list = new ArrayList<>();
|
ArrayList<String> list = new ArrayList<>();
|
||||||
list.add("");
|
list.add("");
|
||||||
DBHelper helper = new DBHelper(MainActivity.this);
|
DBHelper helper = new DBHelper(MainActivity.this);
|
||||||
Cursor cursor = helper.category("");
|
Cursor cursor = helper.category();
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String s = cursor.getString(cursor.getColumnIndex("category"));
|
String s = cursor.getString(cursor.getColumnIndex("category"));
|
||||||
|
@ -959,6 +959,10 @@ public class MainActivity extends Activity {
|
||||||
unregisterReceiver(receiver);
|
unregisterReceiver(receiver);
|
||||||
MainActivity.this.finish();
|
MainActivity.this.finish();
|
||||||
break;
|
break;
|
||||||
|
case 20:
|
||||||
|
intent = new Intent(MainActivity.this, FavoriteActivity1.class);
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">海天鹰浏览器</string>
|
<string name="app_name">海天鹰浏览器</string>
|
||||||
<string name="title_activity_settings">Settings</string>
|
</resources>
|
||||||
</resources>
|
|
||||||
|
|
Loading…
Reference in New Issue