<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
+ <uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
import android.content.Intent;
import android.graphics.Rect;
import android.net.Uri;
+import android.nfc.NdefMessage;
+import android.nfc.NdefRecord;
+import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
private ScreenNailHolder mScreenNailHolder;
private ScreenNail mScreenNail;
+ private NfcAdapter mNfcAdapter;
+
public static interface Model extends PhotoView.Model {
public void resume();
public void pause();
mApplication = (GalleryApp)((Activity) mActivity).getApplication();
mSetPathString = data.getString(KEY_MEDIA_SET_PATH);
+ mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity.getAndroidContext());
Path itemPath = Path.fromString(data.getString(KEY_MEDIA_ITEM_PATH));
if (mSetPathString != null) {
intent.setType(MenuExecutor.getMimeType(type));
intent.putExtra(Intent.EXTRA_STREAM, manager.getContentUri(path));
mShareActionProvider.setShareIntent(intent);
+ if (mNfcAdapter != null) {
+ mNfcAdapter.setBeamPushUri(MenuExecutor.getMimeType(type),
+ manager.getContentUri(path), (Activity)mActivity);
+ }
mPendingSharePath = null;
} else {
// This happens when ActionBar is not created yet.
mModel.pause();
mHandler.removeMessages(MSG_HIDE_BARS);
mActionBar.removeOnMenuVisibilityListener(mMenuVisibilityListener);
+
mMenuExecutor.pause();
}
}
mActionBar.setDisplayOptions(mSetPathString != null, true);
mActionBar.addOnMenuVisibilityListener(mMenuVisibilityListener);
+
onUserInteraction();
}
return mIndex;
}
}
+
}