Fix crashes when NFC isn't supported.

Change-Id: I638a1e4e5d7a0b5d4f84668e134b13457aeaa879
This commit is contained in:
Jeff Hamilton
2011-07-20 23:22:00 -05:00
parent 7d421c5b02
commit 9d7ed78e7a

View File

@@ -75,7 +75,8 @@ public class ForegroundDispatch extends Activity {
@Override
public void onResume() {
super.onResume();
mAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters, mTechLists);
if (mAdapter != null) mAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters,
mTechLists);
}
@Override
@@ -87,7 +88,6 @@ public class ForegroundDispatch extends Activity {
@Override
public void onPause() {
super.onPause();
//mAdapter.disableForegroundDispatch(this);
throw new RuntimeException("onPause not implemented to fix build");
if (mAdapter != null) mAdapter.disableForegroundDispatch(this);
}
}