summaryrefslogtreecommitdiffstats
path: root/media/tests/CameraBrowser/src
diff options
context:
space:
mode:
Diffstat (limited to 'media/tests/CameraBrowser/src')
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java103
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java50
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java156
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java190
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java84
-rw-r--r--media/tests/CameraBrowser/src/com/android/camerabrowser/UsbReceiver.java47
6 files changed, 0 insertions, 630 deletions
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java
deleted file mode 100644
index 0942d1f..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/CameraBrowser.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.app.ListActivity;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.database.ContentObserver;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.provider.Ptp;
-import android.util.Log;
-import android.view.View;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.SimpleCursorAdapter;
-
- /**
- * A list view displaying all connected cameras.
- */
-public class CameraBrowser extends ListActivity {
-
- private static final String TAG = "CameraBrowser";
-
- private ListAdapter mAdapter;
- private ContentResolver mResolver;
- private DeviceObserver mDeviceObserver;
- private Cursor mCursor;
-
- private class DeviceObserver extends ContentObserver {
- DeviceObserver(Handler handler) {
- super(handler);
- }
-
- @Override
- public void onChange(boolean selfChange) {
- Log.d(TAG, "DeviceObserver.onChange");
- if (mCursor != null) {
- mCursor.requery();
- }
- }
- }
-
- private static final String[] DEVICE_COLUMNS =
- new String[] { Ptp.Device._ID, Ptp.Device.MANUFACTURER, Ptp.Device.MODEL };
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mResolver = getContentResolver();
- mDeviceObserver = new DeviceObserver(new Handler());
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- Cursor c = getContentResolver().query(Ptp.Device.CONTENT_URI,
- DEVICE_COLUMNS, null, null, null);
- Log.d(TAG, "query returned " + c);
- startManagingCursor(c);
- mCursor = c;
-
- // Map Cursor columns to views defined in simple_list_item_2.xml
- mAdapter = new SimpleCursorAdapter(this,
- android.R.layout.simple_list_item_2, c,
- new String[] { Ptp.Device.MANUFACTURER, Ptp.Device.MODEL },
- new int[] { android.R.id.text1, android.R.id.text2 });
- setListAdapter(mAdapter);
-
- // register for changes to the device list
- mResolver.registerContentObserver(Ptp.Device.CONTENT_URI, true, mDeviceObserver);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- mResolver.unregisterContentObserver(mDeviceObserver);
- }
-
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- Intent intent = new Intent(this, StorageBrowser.class);
- intent.putExtra("device", (int)mAdapter.getItemId(position));
- startActivity(intent);
- }
-}
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java
deleted file mode 100644
index d5e433b..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/DeviceDisconnectedReceiver.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.hardware.UsbManager;
-import android.net.Uri;
-
-public class DeviceDisconnectedReceiver extends BroadcastReceiver {
-
- private final Activity mActivity;
- private final int mDeviceID;
-
- public DeviceDisconnectedReceiver(Activity activity, int deviceID) {
- mActivity = activity;
- mDeviceID = deviceID;
-
- IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_CAMERA_DETACHED);
- filter.addDataScheme("content");
- activity.registerReceiver(this, filter);
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- // close our activity if the device it is displaying is disconnected
- Uri uri = intent.getData();
- int id = Integer.parseInt(uri.getPathSegments().get(1));
- if (id == mDeviceID) {
- mActivity.finish();
- }
- }
-} \ No newline at end of file
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
deleted file mode 100644
index 601c5be..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectBrowser.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.app.ListActivity;
-import android.content.Context;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.mtp.MtpConstants;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.Ptp;
-import android.util.Log;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.ResourceCursorAdapter;
-import android.widget.TextView;
-
- /**
- * A list view displaying all objects within a container (folder or storage unit).
- */
-public class ObjectBrowser extends ListActivity {
-
- private static final String TAG = "ObjectBrowser";
-
- private Cursor mCursor;
- private ObjectCursorAdapter mAdapter;
- private int mDeviceID;
- private long mStorageID;
- private long mObjectID;
- private DeviceDisconnectedReceiver mDisconnectedReceiver;
-
- private static final String[] OBJECT_COLUMNS =
- new String[] { Ptp.Object._ID, Ptp.Object.NAME, Ptp.Object.FORMAT, Ptp.Object.THUMB };
-
- static final int ID_COLUMN = 0;
- static final int NAME_COLUMN = 1;
- static final int FORMAT_COLUMN = 2;
- static final int THUMB_COLUMN = 3;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mDeviceID = getIntent().getIntExtra("device", 0);
- mStorageID = getIntent().getLongExtra("storage", 0);
- mObjectID = getIntent().getLongExtra("object", 0);
- mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceID);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- if (mDeviceID != 0 && mStorageID != 0) {
- Cursor c;
- Uri uri;
- if (mObjectID == 0) {
- uri = Ptp.Object.getContentUriForStorageChildren(mDeviceID, mStorageID);
- } else {
- uri = Ptp.Object.getContentUriForObjectChildren(mDeviceID, mObjectID);
- }
- Log.d(TAG, "query " + uri);
- c = getContentResolver().query(uri, OBJECT_COLUMNS, null, null, null);
- startManagingCursor(c);
- mCursor = c;
-
- // Map Cursor columns to views defined in simple_list_item_1.xml
- mAdapter = new ObjectCursorAdapter(this, c);
- setListAdapter(mAdapter);
- }
- }
-
- @Override
- protected void onDestroy() {
- unregisterReceiver(mDisconnectedReceiver);
- super.onDestroy();
- }
-
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- long rowID = mAdapter.getItemId(position);
- Cursor c = getContentResolver().query(
- Ptp.Object.getContentUri(mDeviceID, rowID),
- OBJECT_COLUMNS, null, null, null);
- Log.d(TAG, "query returned " + c + " count: " + c.getCount());
- long format = 0;
- if (c != null && c.getCount() == 1) {
- c.moveToFirst();
- long rowId = c.getLong(ID_COLUMN);
- String name = c.getString(NAME_COLUMN);
- format = c.getLong(FORMAT_COLUMN);
- Log.d(TAG, "rowId: " + rowId + " name: " + name + " format: " + format);
- }
- if (format == MtpConstants.FORMAT_ASSOCIATION) {
- Intent intent = new Intent(this, ObjectBrowser.class);
- intent.putExtra("device", mDeviceID);
- intent.putExtra("storage", mStorageID);
- intent.putExtra("object", rowID);
- startActivity(intent);
- } else {
- Intent intent = new Intent(this, ObjectViewer.class);
- intent.putExtra("device", mDeviceID);
- intent.putExtra("storage", mStorageID);
- intent.putExtra("object", rowID);
- startActivity(intent);
- }
- }
-
- private class ObjectCursorAdapter extends ResourceCursorAdapter {
-
- public ObjectCursorAdapter(Context context, Cursor c) {
- super(context, R.layout.object_list, c);
- }
-
- @Override
- public void bindView(View view, Context context, Cursor cursor) {
- ImageView thumbView = (ImageView)view.findViewById(R.id.thumbnail);
- TextView nameView = (TextView)view.findViewById(R.id.name);
-
- // get the thumbnail
- byte[] thumbnail = cursor.getBlob(THUMB_COLUMN);
- if (thumbnail != null) {
- Bitmap bitmap = BitmapFactory.decodeByteArray(thumbnail, 0, thumbnail.length);
- if (bitmap != null) {
- thumbView.setImageBitmap(bitmap);
- }
- }
-
- // get the name
- String name = cursor.getString(NAME_COLUMN);
- if (name == null) {
- name = "";
- }
- nameView.setText(name);
- }
- }
-}
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
deleted file mode 100644
index d53dbff..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/ObjectViewer.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Environment;
-import android.provider.Ptp;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import java.io.File;
-import java.util.Date;
-
-/**
- * A view to display the properties of an object.
- */
-public class ObjectViewer extends Activity implements View.OnClickListener {
-
- private static final String TAG = "ObjectViewer";
-
- private int mDeviceID;
- private long mStorageID;
- private long mObjectID;
- private String mFileName;
- private Button mImportButton;
- private Button mDeleteButton;
- private DeviceDisconnectedReceiver mDisconnectedReceiver;
-
- private static final String[] OBJECT_COLUMNS =
- new String[] { Ptp.Object._ID,
- Ptp.Object.NAME,
- Ptp.Object.SIZE,
- Ptp.Object.THUMB_WIDTH,
- Ptp.Object.THUMB_HEIGHT,
- Ptp.Object.THUMB_SIZE,
- Ptp.Object.IMAGE_WIDTH,
- Ptp.Object.IMAGE_HEIGHT,
- Ptp.Object.IMAGE_DEPTH,
- Ptp.Object.SEQUENCE_NUMBER,
- Ptp.Object.DATE_CREATED,
- Ptp.Object.DATE_MODIFIED,
- Ptp.Object.KEYWORDS,
- Ptp.Object.THUMB,
- Ptp.Object.FORMAT,
- };
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.object_info);
-
- mImportButton = (Button)findViewById(R.id.import_button);
- mImportButton.setOnClickListener(this);
- mDeleteButton = (Button)findViewById(R.id.delete_button);
- mDeleteButton.setOnClickListener(this);
-
- mDeviceID = getIntent().getIntExtra("device", 0);
- mStorageID = getIntent().getLongExtra("storage", 0);
- mObjectID = getIntent().getLongExtra("object", 0);
- mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceID);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- if (mDeviceID != 0 && mObjectID != 0) {
- Cursor c = getContentResolver().query(
- Ptp.Object.getContentUri(mDeviceID, mObjectID),
- OBJECT_COLUMNS, null, null, null);
- c.moveToFirst();
- TextView view = (TextView)findViewById(R.id.name);
- mFileName = c.getString(1);
- view.setText(mFileName);
- view = (TextView)findViewById(R.id.size);
- view.setText(Long.toString(c.getLong(2)));
- view = (TextView)findViewById(R.id.thumb_width);
- view.setText(Long.toString(c.getLong(3)));
- view = (TextView)findViewById(R.id.thumb_height);
- view.setText(Long.toString(c.getLong(4)));
- view = (TextView)findViewById(R.id.thumb_size);
- view.setText(Long.toString(c.getLong(5)));
- view = (TextView)findViewById(R.id.width);
- view.setText(Long.toString(c.getLong(6)));
- view = (TextView)findViewById(R.id.height);
- view.setText(Long.toString(c.getLong(7)));
- view = (TextView)findViewById(R.id.depth);
- view.setText(Long.toString(c.getLong(8)));
- view = (TextView)findViewById(R.id.sequence);
- view.setText(Long.toString(c.getLong(9)));
- view = (TextView)findViewById(R.id.created);
- Date date = new Date(c.getLong(10) * 1000);
- view.setText(date.toString());
- view = (TextView)findViewById(R.id.modified);
- date = new Date(c.getLong(11) * 1000);
- view.setText(date.toString());
- view = (TextView)findViewById(R.id.keywords);
- view.setText(c.getString(12));
- byte[] thumbnail = c.getBlob(13);
- if (thumbnail != null) {
- ImageView thumbView = (ImageView)findViewById(R.id.thumbnail);
- Bitmap bitmap = BitmapFactory.decodeByteArray(thumbnail, 0, thumbnail.length);
- if (bitmap != null) {
- thumbView.setImageBitmap(bitmap);
- }
- }
- view = (TextView)findViewById(R.id.format);
- view.setText(Long.toHexString(c.getLong(14)).toUpperCase());
- }
- }
-
- @Override
- protected void onDestroy() {
- unregisterReceiver(mDisconnectedReceiver);
- super.onDestroy();
- }
-
- private void importObject() {
- // copy file to /mnt/sdcard/imported/<filename>
- File dest = Environment.getExternalStorageDirectory();
- dest = new File(dest, "imported");
- dest.mkdirs();
- dest = new File(dest, mFileName);
-
- Uri requestUri = Ptp.Object.getContentUriForImport(mDeviceID, mObjectID,
- dest.getAbsolutePath());
- Uri resultUri = getContentResolver().insert(requestUri, new ContentValues());
- Log.d(TAG, "save returned " + resultUri);
-
- if (resultUri != null) {
- Toast.makeText(this, R.string.object_saved_message, Toast.LENGTH_SHORT).show();
- Intent intent = new Intent(Intent.ACTION_VIEW, resultUri);
- try {
- startActivity(intent);
- } catch (ActivityNotFoundException e) {
- Toast.makeText(this, R.string.start_activity_failed_message, Toast.LENGTH_SHORT).show();
- }
- } else {
- Toast.makeText(this, R.string.save_failed_message, Toast.LENGTH_SHORT).show();
- }
- }
-
- private void deleteObject() {
- Uri uri = Ptp.Object.getContentUri(mDeviceID, mObjectID);
-
- Log.d(TAG, "deleting " + uri);
-
- int result = getContentResolver().delete(uri, null, null);
- if (result > 0) {
- Toast.makeText(this, R.string.object_deleted_message, Toast.LENGTH_SHORT).show();
- finish();
- } else {
- Toast.makeText(this, R.string.delete_failed_message, Toast.LENGTH_SHORT).show();
- }
- }
-
- public void onClick(View v) {
- if (v == mImportButton) {
- importObject();
- } else if (v == mDeleteButton) {
- deleteObject();
- }
- }
-}
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
deleted file mode 100644
index 62187b0..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/StorageBrowser.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.app.ListActivity;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.Ptp;
-import android.util.Log;
-import android.view.View;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.SimpleCursorAdapter;
-
-/**
- * A list view displaying all storage units on a device.
- */
-public class StorageBrowser extends ListActivity {
-
- private static final String TAG = "StorageBrowser";
-
- private ListAdapter mAdapter;
- private int mDeviceID;
- private DeviceDisconnectedReceiver mDisconnectedReceiver;
-
- private static final String[] STORAGE_COLUMNS =
- new String[] { Ptp.Storage._ID, Ptp.Storage.DESCRIPTION };
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mDeviceID = getIntent().getIntExtra("device", 0);
- mDisconnectedReceiver = new DeviceDisconnectedReceiver(this, mDeviceID);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- if (mDeviceID != 0) {
- Cursor c = getContentResolver().query(Ptp.Storage.getContentUri(mDeviceID),
- STORAGE_COLUMNS, null, null, null);
- Log.d(TAG, "query returned " + c);
- startManagingCursor(c);
-
- // Map Cursor columns to views defined in simple_list_item_1.xml
- mAdapter = new SimpleCursorAdapter(this,
- android.R.layout.simple_list_item_1, c,
- new String[] { Ptp.Storage.DESCRIPTION },
- new int[] { android.R.id.text1, android.R.id.text2 });
- setListAdapter(mAdapter);
- }
- }
-
- @Override
- protected void onDestroy() {
- unregisterReceiver(mDisconnectedReceiver);
- super.onDestroy();
- }
-
- @Override
- protected void onListItemClick(ListView l, View v, int position, long id) {
- Intent intent = new Intent(this, ObjectBrowser.class);
- intent.putExtra("device", mDeviceID);
- intent.putExtra("storage", mAdapter.getItemId(position));
- startActivity(intent);
- }
-}
diff --git a/media/tests/CameraBrowser/src/com/android/camerabrowser/UsbReceiver.java b/media/tests/CameraBrowser/src/com/android/camerabrowser/UsbReceiver.java
deleted file mode 100644
index 07e5a23..0000000
--- a/media/tests/CameraBrowser/src/com/android/camerabrowser/UsbReceiver.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2010 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.camerabrowser;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.BroadcastReceiver;
-import android.hardware.UsbManager;
-import android.net.Uri;
-import android.util.Log;
-
-public class UsbReceiver extends BroadcastReceiver
-{
- private static final String TAG = "UsbReceiver";
-
- @Override
- public void onReceive(Context context, Intent intent) {
- Log.d(TAG, "onReceive " + intent);
- if (UsbManager.ACTION_USB_CAMERA_ATTACHED.equals(intent.getAction())) {
- Uri uri = intent.getData();
- intent = new Intent(context, StorageBrowser.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- try {
- // TODO - add a wrapper to Mtp.Device for this
- int id = Integer.parseInt(uri.getPathSegments().get(1));
- intent.putExtra("device", id);
- context.startActivity(intent);
- } catch (NumberFormatException e) {
- Log.e(TAG, "bad device Uri " + uri);
- }
- }
- }
-}