aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PermissionApp/AndroidManifest.xml4
-rw-r--r--PermissionApp/res/drawable/header_background.xml21
-rw-r--r--PermissionApp/res/layout/permission_activity.xml71
-rw-r--r--PermissionApp/res/menu/actions.xml34
-rw-r--r--PermissionApp/res/values/colors.xml20
-rw-r--r--PermissionApp/res/values/strings.xml8
-rw-r--r--PermissionApp/src/foo/bar/permission/PermissionActivity.java60
-rw-r--r--PermissionApp2/AndroidManifest.xml4
-rw-r--r--PermissionApp2/res/drawable/header_background.xml21
-rw-r--r--PermissionApp2/res/layout/permission_activity.xml71
-rw-r--r--PermissionApp2/res/menu/actions.xml34
-rw-r--r--PermissionApp2/res/values/colors.xml20
-rw-r--r--PermissionApp2/res/values/strings.xml8
-rw-r--r--PermissionApp2/src/foo/bar/permission2/PermissionActivity.java59
-rw-r--r--PrintApp/src/foo/bar/permission2/PrintActivity.java (renamed from PrintApp/src/foo/bar/permission/PrintActivity.java)2
15 files changed, 325 insertions, 112 deletions
diff --git a/PermissionApp/AndroidManifest.xml b/PermissionApp/AndroidManifest.xml
index 9d6d98f..8807e94 100644
--- a/PermissionApp/AndroidManifest.xml
+++ b/PermissionApp/AndroidManifest.xml
@@ -1,12 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foo.bar.permission"
android:versionCode="1"
- android:versionName="1.0"
- android:sharedUserId="foo.bar.permissions">
+ android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="10000"/>
- <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
diff --git a/PermissionApp/res/drawable/header_background.xml b/PermissionApp/res/drawable/header_background.xml
new file mode 100644
index 0000000..f26c6f3
--- /dev/null
+++ b/PermissionApp/res/drawable/header_background.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item android:drawable="@color/header_background_color" />
+</ripple>
+
diff --git a/PermissionApp/res/layout/permission_activity.xml b/PermissionApp/res/layout/permission_activity.xml
index 5b05791..01f734e 100644
--- a/PermissionApp/res/layout/permission_activity.xml
+++ b/PermissionApp/res/layout/permission_activity.xml
@@ -1,38 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
tools:context=".MainActivity"
android:orientation="vertical" >
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/show_contacts"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/show_contacts">
- </Button>
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="?android:attr/actionBarSize"
+ android:background="@drawable/header_background"
+ android:theme="@android:style/Theme.Material.Settings" >
- <Button
- android:id="@+id/show_events"
- android:layout_width="wrap_content"
+ <TextView
android:layout_height="wrap_content"
- android:text="@string/show_calls">
- </Button>
-
- <Button
- android:id="@+id/request_permissions"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/request_permissions">
- </Button>
+ android:layout_gravity="center"
+ android:textAppearance="@android:style/TextAppearance.Material.Medium"
+ android:textColor="@android:color/white"
+ android:text="@string/list_title">
+ </TextView>
- </LinearLayout>
+ </FrameLayout>
<ListView
android:id="@+id/list"
@@ -42,4 +48,21 @@
android:orientation="vertical">
</ListView>
+ <FrameLayout
+ android:id="@+id/empty_state"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:visibility="gone">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textColor="?android:attr/textColorSecondary"
+ android:text="@string/action_prompt">
+ </TextView>
+
+ </FrameLayout>
+
</LinearLayout>
diff --git a/PermissionApp/res/menu/actions.xml b/PermissionApp/res/menu/actions.xml
new file mode 100644
index 0000000..66e43dd
--- /dev/null
+++ b/PermissionApp/res/menu/actions.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/show_contacts"
+ android:title="@string/show_contacts">
+ </item>
+
+ <item
+ android:id="@+id/show_events"
+ android:title="@string/show_events">
+ </item>
+
+ <item
+ android:id="@+id/request_all_perms"
+ android:title="@string/request_all_perms">
+ </item>
+
+</menu>
diff --git a/PermissionApp/res/values/colors.xml b/PermissionApp/res/values/colors.xml
new file mode 100644
index 0000000..f57f035
--- /dev/null
+++ b/PermissionApp/res/values/colors.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<resources>
+ <color name="header_background_color">#ff37474f</color>
+</resources>
+
diff --git a/PermissionApp/res/values/strings.xml b/PermissionApp/res/values/strings.xml
index cdc6a46..885a8a9 100644
--- a/PermissionApp/res/values/strings.xml
+++ b/PermissionApp/res/values/strings.xml
@@ -16,9 +16,11 @@
<resources>
- <string name="app_name">Permission</string>
+ <string name="app_name">Runtime permissionz</string>
<string name="show_contacts">Contacts</string>
- <string name="show_calls">Events</string>
- <string name="request_permissions">Permissions</string>
+ <string name="show_events">Events</string>
+ <string name="request_all_perms">Request permissions</string>
+ <string name="list_title">Here is some permission protected stuff</string>
+ <string name="action_prompt">Almost worked\u2026</string>
</resources>
diff --git a/PermissionApp/src/foo/bar/permission/PermissionActivity.java b/PermissionApp/src/foo/bar/permission/PermissionActivity.java
index b61f511..a99106b 100644
--- a/PermissionApp/src/foo/bar/permission/PermissionActivity.java
+++ b/PermissionApp/src/foo/bar/permission/PermissionActivity.java
@@ -26,8 +26,9 @@ import android.database.Cursor;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.provider.ContactsContract;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
-import android.widget.Button;
import android.widget.CursorAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
@@ -35,8 +36,7 @@ import android.widget.SimpleCursorAdapter;
/**
* Simple sample of how to use the runtime permissions APIs.
*/
-public class PermissionActivity extends Activity implements View.OnClickListener,
- LoaderManager.LoaderCallbacks<Cursor> {
+public class PermissionActivity extends Activity implements LoaderManager.LoaderCallbacks<Cursor> {
public static final String LOG_TAG = "PermissionActivity";
@@ -73,9 +73,6 @@ public class PermissionActivity extends Activity implements View.OnClickListener
};
private ListView mListView;
- private Button mContactsButton;
- private Button mEventsButton;
- private Button mPermissionsButton;
private CursorAdapter mContactsAdapter;
private CursorAdapter mEventsAdapter;
@@ -86,28 +83,46 @@ public class PermissionActivity extends Activity implements View.OnClickListener
bindUi();
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(foo.bar.permission2.R.menu.actions, menu);
+ return true;
+ }
+
@Override
- public void onClick(View view) {
- if (view == mContactsButton) {
- showContacts();
- } else if (view == mEventsButton) {
- showEvents();
- } else if (view == mPermissionsButton) {
- requestPermissions();
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case foo.bar.permission2.R.id.show_contacts: {
+ showContacts();
+ return true;
+ }
+
+ case foo.bar.permission2.R.id.show_events: {
+ showEvents();
+ return true;
+ }
+
+ case foo.bar.permission2.R.id.request_all_perms: {
+ requestPermissions();
+ return true;
+ }
}
+
+ return false;
}
@Override
public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
switch (loaderId) {
case CONTACTS_LOADER: {
- return new CursorLoader(PermissionActivity.this,
+ return new CursorLoader(this,
ContactsContract.Contacts.CONTENT_URI,
CONTACTS_PROJECTION, null, null, null);
}
case EVENTS_LOADER: {
- return new CursorLoader(PermissionActivity.this,
+ return new CursorLoader(this,
CalendarContract.Events.CONTENT_URI,
EVENTS_PROJECTION, null, null, null);
}
@@ -163,18 +178,11 @@ public class PermissionActivity extends Activity implements View.OnClickListener
}
private void bindUi() {
- setContentView(R.layout.permission_activity);
-
- mListView = (ListView) findViewById(R.id.list);
-
- mContactsButton = (Button) findViewById(R.id.show_contacts);
- mContactsButton.setOnClickListener(this);
-
- mEventsButton = (Button) findViewById(R.id.show_events);
- mEventsButton.setOnClickListener(this);
+ setContentView(foo.bar.permission2.R.layout.permission_activity);
- mPermissionsButton = (Button) findViewById(R.id.request_permissions);
- mPermissionsButton.setOnClickListener(this);
+ mListView = (ListView) findViewById(foo.bar.permission2.R.id.list);
+ View emptyView = findViewById(foo.bar.permission2.R.id.empty_state);
+ mListView.setEmptyView(emptyView);
mContactsAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
diff --git a/PermissionApp2/AndroidManifest.xml b/PermissionApp2/AndroidManifest.xml
index ab55be8..8de044d 100644
--- a/PermissionApp2/AndroidManifest.xml
+++ b/PermissionApp2/AndroidManifest.xml
@@ -1,11 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foo.bar.permission2"
android:versionCode="1"
- android:versionName="1.0"
- android:sharedUserId="foo.bar.permissionz">
+ android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="10000"/>
+ <uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<application
diff --git a/PermissionApp2/res/drawable/header_background.xml b/PermissionApp2/res/drawable/header_background.xml
new file mode 100644
index 0000000..f26c6f3
--- /dev/null
+++ b/PermissionApp2/res/drawable/header_background.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item android:drawable="@color/header_background_color" />
+</ripple>
+
diff --git a/PermissionApp2/res/layout/permission_activity.xml b/PermissionApp2/res/layout/permission_activity.xml
index 5b05791..01f734e 100644
--- a/PermissionApp2/res/layout/permission_activity.xml
+++ b/PermissionApp2/res/layout/permission_activity.xml
@@ -1,38 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
tools:context=".MainActivity"
android:orientation="vertical" >
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <Button
- android:id="@+id/show_contacts"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/show_contacts">
- </Button>
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="?android:attr/actionBarSize"
+ android:background="@drawable/header_background"
+ android:theme="@android:style/Theme.Material.Settings" >
- <Button
- android:id="@+id/show_events"
- android:layout_width="wrap_content"
+ <TextView
android:layout_height="wrap_content"
- android:text="@string/show_calls">
- </Button>
-
- <Button
- android:id="@+id/request_permissions"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/request_permissions">
- </Button>
+ android:layout_gravity="center"
+ android:textAppearance="@android:style/TextAppearance.Material.Medium"
+ android:textColor="@android:color/white"
+ android:text="@string/list_title">
+ </TextView>
- </LinearLayout>
+ </FrameLayout>
<ListView
android:id="@+id/list"
@@ -42,4 +48,21 @@
android:orientation="vertical">
</ListView>
+ <FrameLayout
+ android:id="@+id/empty_state"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:visibility="gone">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textColor="?android:attr/textColorSecondary"
+ android:text="@string/action_prompt">
+ </TextView>
+
+ </FrameLayout>
+
</LinearLayout>
diff --git a/PermissionApp2/res/menu/actions.xml b/PermissionApp2/res/menu/actions.xml
new file mode 100644
index 0000000..66e43dd
--- /dev/null
+++ b/PermissionApp2/res/menu/actions.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/show_contacts"
+ android:title="@string/show_contacts">
+ </item>
+
+ <item
+ android:id="@+id/show_events"
+ android:title="@string/show_events">
+ </item>
+
+ <item
+ android:id="@+id/request_all_perms"
+ android:title="@string/request_all_perms">
+ </item>
+
+</menu>
diff --git a/PermissionApp2/res/values/colors.xml b/PermissionApp2/res/values/colors.xml
new file mode 100644
index 0000000..f57f035
--- /dev/null
+++ b/PermissionApp2/res/values/colors.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<resources>
+ <color name="header_background_color">#ff37474f</color>
+</resources>
+
diff --git a/PermissionApp2/res/values/strings.xml b/PermissionApp2/res/values/strings.xml
index be68caa..7c4667d 100644
--- a/PermissionApp2/res/values/strings.xml
+++ b/PermissionApp2/res/values/strings.xml
@@ -16,9 +16,11 @@
<resources>
- <string name="app_name">Permission 2</string>
+ <string name="app_name">Runtime permissionz2</string>
<string name="show_contacts">Contacts</string>
- <string name="show_calls">Events</string>
- <string name="request_permissions">Permissions</string>
+ <string name="show_events">Events</string>
+ <string name="request_all_perms">Request permissions</string>
+ <string name="list_title">Here is some permission protected stuff</string>
+ <string name="action_prompt">Almost worked\u2026</string>
</resources>
diff --git a/PermissionApp2/src/foo/bar/permission2/PermissionActivity.java b/PermissionApp2/src/foo/bar/permission2/PermissionActivity.java
index cf48136..d44de53 100644
--- a/PermissionApp2/src/foo/bar/permission2/PermissionActivity.java
+++ b/PermissionApp2/src/foo/bar/permission2/PermissionActivity.java
@@ -26,18 +26,17 @@ import android.database.Cursor;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.provider.ContactsContract;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
-import android.widget.Button;
import android.widget.CursorAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
-import foo.bar.permission.R;
/**
* Simple sample of how to use the runtime permissions APIs.
*/
-public class PermissionActivity extends Activity implements View.OnClickListener,
- LoaderManager.LoaderCallbacks<Cursor> {
+public class PermissionActivity extends Activity implements LoaderManager.LoaderCallbacks<Cursor> {
public static final String LOG_TAG = "PermissionActivity";
@@ -74,9 +73,6 @@ public class PermissionActivity extends Activity implements View.OnClickListener
};
private ListView mListView;
- private Button mContactsButton;
- private Button mEventsButton;
- private Button mPermissionsButton;
private CursorAdapter mContactsAdapter;
private CursorAdapter mEventsAdapter;
@@ -87,28 +83,46 @@ public class PermissionActivity extends Activity implements View.OnClickListener
bindUi();
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.actions, menu);
+ return true;
+ }
+
@Override
- public void onClick(View view) {
- if (view == mContactsButton) {
- showContacts();
- } else if (view == mEventsButton) {
- showEvents();
- } else if (view == mPermissionsButton) {
- requestPermissions();
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.show_contacts: {
+ showContacts();
+ return true;
+ }
+
+ case R.id.show_events: {
+ showEvents();
+ return true;
+ }
+
+ case R.id.request_all_perms: {
+ requestPermissions();
+ return true;
+ }
}
+
+ return false;
}
@Override
public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {
switch (loaderId) {
case CONTACTS_LOADER: {
- return new CursorLoader(PermissionActivity.this,
+ return new CursorLoader(this,
ContactsContract.Contacts.CONTENT_URI,
CONTACTS_PROJECTION, null, null, null);
}
case EVENTS_LOADER: {
- return new CursorLoader(PermissionActivity.this,
+ return new CursorLoader(this,
CalendarContract.Events.CONTENT_URI,
EVENTS_PROJECTION, null, null, null);
}
@@ -167,15 +181,8 @@ public class PermissionActivity extends Activity implements View.OnClickListener
setContentView(R.layout.permission_activity);
mListView = (ListView) findViewById(R.id.list);
-
- mContactsButton = (Button) findViewById(R.id.show_contacts);
- mContactsButton.setOnClickListener(this);
-
- mEventsButton = (Button) findViewById(R.id.show_events);
- mEventsButton.setOnClickListener(this);
-
- mPermissionsButton = (Button) findViewById(R.id.request_permissions);
- mPermissionsButton.setOnClickListener(this);
+ View emptyView = findViewById(R.id.empty_state);
+ mListView.setEmptyView(emptyView);
mContactsAdapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_1,
@@ -219,7 +226,7 @@ public class PermissionActivity extends Activity implements View.OnClickListener
!= PackageManager.PERMISSION_GRANTED
|| checkSelfPermission(Manifest.permission.READ_CONTACTS)
!= PackageManager.PERMISSION_GRANTED) {
- String[] permissions = new String[] {
+ String[] permissions = new String[]{
Manifest.permission.READ_CONTACTS,
Manifest.permission.READ_CALENDAR
};
diff --git a/PrintApp/src/foo/bar/permission/PrintActivity.java b/PrintApp/src/foo/bar/permission2/PrintActivity.java
index 7b5a355..34bec6f 100644
--- a/PrintApp/src/foo/bar/permission/PrintActivity.java
+++ b/PrintApp/src/foo/bar/permission2/PrintActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package foo.bar.permission;
+package foo.bar.permission2;
import java.io.FileOutputStream;
import java.io.IOException;