merge in ics-mr1-release history after reset to ics-mr1
diff --git a/samples/SearchableDictionary/AndroidManifest.xml b/samples/SearchableDictionary/AndroidManifest.xml
index 5d835ee..d8fed69 100644
--- a/samples/SearchableDictionary/AndroidManifest.xml
+++ b/samples/SearchableDictionary/AndroidManifest.xml
@@ -21,7 +21,7 @@
android:versionCode="2"
android:versionName="2.0">
- <uses-sdk android:minSdkVersion="11" />
+ <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15" />
<application android:label="@string/app_name"
android:icon="@drawable/ic_dictionary">
diff --git a/samples/SearchableDictionary/res/menu/options_menu.xml b/samples/SearchableDictionary/res/menu/options_menu.xml
index c35c7d4..06f9958 100644
--- a/samples/SearchableDictionary/res/menu/options_menu.xml
+++ b/samples/SearchableDictionary/res/menu/options_menu.xml
@@ -21,6 +21,6 @@
<item android:id="@+id/search"
android:title="@string/menu_search"
android:icon="@drawable/ic_menu_search"
- android:showAsAction="ifRoom"
+ android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView" />
</menu>
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
index a83ebce..a65953b 100644
--- a/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
@@ -23,6 +23,7 @@
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
@@ -59,7 +60,7 @@
@Override
protected void onNewIntent(Intent intent) {
// Because this activity has set launchMode="singleTop", the system calls this method
- // to deliver the intent if this actvity is currently the foreground activity when
+ // to deliver the intent if this activity is currently the foreground activity when
// invoked again (when the user executes a search from this activity, we don't create
// a new instance of this activity, so the system delivers the search intent here)
handleIntent(intent);
@@ -71,7 +72,6 @@
Intent wordIntent = new Intent(this, WordActivity.class);
wordIntent.setData(intent.getData());
startActivity(wordIntent);
- finish();
} else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
// handles a search query
String query = intent.getStringExtra(SearchManager.QUERY);
@@ -113,6 +113,8 @@
// Define the on-click listener for the list items
mListView.setOnItemClickListener(new OnItemClickListener() {
+
+ @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Build the Intent used to open WordActivity with a specific word Uri
Intent wordIntent = new Intent(getApplicationContext(), WordActivity.class);
@@ -130,10 +132,12 @@
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
- SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
- searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
- searchView.setIconifiedByDefault(false);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
+ SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+ SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
+ searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
+ searchView.setIconifiedByDefault(false);
+ }
return true;
}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
index d56a145..d78e494 100644
--- a/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
@@ -23,6 +23,7 @@
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
@@ -34,14 +35,15 @@
* Displays a word and its definition.
*/
public class WordActivity extends Activity {
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.word);
- ActionBar actionBar = getActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
+ ActionBar actionBar = getActionBar();
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ }
Uri uri = getIntent().getData();
Cursor cursor = managedQuery(uri, null, null, null, null);
@@ -67,10 +69,12 @@
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
- SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
- searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
- searchView.setIconifiedByDefault(false);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
+ SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
+ SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView();
+ searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
+ searchView.setIconifiedByDefault(false);
+ }
return true;
}
diff --git a/sdk/prebuilt/v7/gridlayout/.classpath b/sdk/prebuilt/v7/gridlayout/.classpath
new file mode 100644
index 0000000..a4f1e40
--- /dev/null
+++ b/sdk/prebuilt/v7/gridlayout/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/sdk/prebuilt/v7/gridlayout/.project b/sdk/prebuilt/v7/gridlayout/.project
new file mode 100644
index 0000000..ed51f1d
--- /dev/null
+++ b/sdk/prebuilt/v7/gridlayout/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gridlayout_v7</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/sdk/prebuilt/v7/gridlayout/README.txt b/sdk/prebuilt/v7/gridlayout/README.txt
new file mode 100644
index 0000000..86853b0
--- /dev/null
+++ b/sdk/prebuilt/v7/gridlayout/README.txt
@@ -0,0 +1,8 @@
+Library Project including GridLayout.
+
+This can be used by an Android project to provide
+access to GridLayout on applications running on API 7+
+
+There is technically no source, but the src folder is necessary
+to ensure that the build system works. The content is actually
+located in libs/android-support-v7-gridlayout.jar