From e90ede446d39dfbee45bcaef6a5ae876a5c92752 Mon Sep 17 00:00:00 2001 From: Bjorn Bringert Date: Wed, 29 Apr 2009 22:33:52 +0100 Subject: Add bookmarks search activity to browser. This activity is never started from the browser. Its purpose is to provide bookmark suggestions to global search (through its searchable meta-data), and to handle the intents produced by clicking such suggestions. --- AndroidManifest.xml | 13 +++++++++ res/values/strings.xml | 2 ++ res/xml/bookmarks_searchable.xml | 28 ++++++++++++++++++ src/com/android/browser/BookmarkSearch.java | 44 +++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 res/xml/bookmarks_searchable.xml create mode 100644 src/com/android/browser/BookmarkSearch.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c67cc97..ace5750 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -176,6 +176,19 @@ android:theme="@android:style/Theme.Dialog"> + + + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 98142ac..040cf45 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -38,6 +38,8 @@ Password Sign in + + Bookmarks & history Cancel diff --git a/res/xml/bookmarks_searchable.xml b/res/xml/bookmarks_searchable.xml new file mode 100644 index 0000000..1508606 --- /dev/null +++ b/res/xml/bookmarks_searchable.xml @@ -0,0 +1,28 @@ + + + + diff --git a/src/com/android/browser/BookmarkSearch.java b/src/com/android/browser/BookmarkSearch.java new file mode 100644 index 0000000..4d3ca0f --- /dev/null +++ b/src/com/android/browser/BookmarkSearch.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.browser; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +/** + * This activity is never started from the browser. Its purpose is to provide bookmark suggestions + * to global search (through its searchable meta-data), and to handle the intents produced + * by clicking such suggestions. + */ +public class BookmarkSearch extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Intent intent = getIntent(); + if (intent != null) { + String action = intent.getAction(); + if (Intent.ACTION_VIEW.equals(action)) { + intent.setClass(this, BrowserActivity.class); + startActivity(intent); + } + } + finish(); + } + +} -- cgit v1.1