mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
fix assertion on newer devices by letting the compiler do its job
This commit is contained in:
parent
fb3b6ff96d
commit
fe64f89788
2 changed files with 5 additions and 7 deletions
|
@ -545,7 +545,7 @@ public class BoardDelegate extends DelegateBase
|
|||
m_haveInvited = intent.getBooleanExtra( GameUtils.INVITED, false );
|
||||
m_overNotShown = true;
|
||||
|
||||
NFCUtils.register( m_activity ); // Don't seem to need to unregister...
|
||||
NFCUtils.register( m_activity, this ); // Don't seem to need to unregister...
|
||||
|
||||
setBackgroundColor();
|
||||
setKeepScreenOn();
|
||||
|
|
|
@ -53,19 +53,17 @@ public class NFCUtils {
|
|||
}
|
||||
|
||||
private static interface SafeNFC {
|
||||
public void register( Activity activity );
|
||||
public void register( Activity activity, NFCActor actor );
|
||||
}
|
||||
|
||||
private static class SafeNFCImpl implements SafeNFC {
|
||||
public void register( final Activity activity )
|
||||
public void register( final Activity activity, final NFCActor actor )
|
||||
{
|
||||
Assert.assertTrue( activity instanceof NFCActor );
|
||||
NfcManager manager =
|
||||
(NfcManager)activity.getSystemService( Context.NFC_SERVICE );
|
||||
if ( null != manager ) {
|
||||
NfcAdapter adapter = manager.getDefaultAdapter();
|
||||
if ( null != adapter ) {
|
||||
final NFCActor actor = (NFCActor)activity;
|
||||
NfcAdapter.CreateNdefMessageCallback cb =
|
||||
new NfcAdapter.CreateNdefMessageCallback() {
|
||||
public NdefMessage createNdefMessage( NfcEvent evt )
|
||||
|
@ -117,10 +115,10 @@ public class NFCUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static void register( Activity activity )
|
||||
public static void register( Activity activity, NFCActor actor )
|
||||
{
|
||||
if ( null != s_safeNFC ) {
|
||||
s_safeNFC.register( activity );
|
||||
s_safeNFC.register( activity, actor );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue