Page 134 - 3-2
P. 134

import android.os.AsyncTask;
            import android.nfc.tech.MifareClassic;
            import android.nfc.tech.MifareUltralight;
            import java.io.ByteArrayOutputStream;


            public class MainActivity_tag extends AppCompatActivity {


                private static final String TAG_CODE = "code";


                private NfcAdapter nfcAdapter;
                private TextView status;


                String tagnum = "";
                int sum_price=0;


                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_main_index); // 화면


                    ActionBar actionBar = getSupportActionBar();
                    actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFC961E));


                    Log.d(" 여긴가", "1");


                    // Loading products in Background Thread
                    Log.d(" 여긴가", "2");




                    Log.d(" 여긴가", "3");


                    Log.d(" 여긴가", "4");


                    nfcAdapter = NfcAdapter.getDefaultAdapter(this);
                    if(nfcAdapter == null){
                        Toast.makeText(this,
                                "NFC NOT supported on this devices!",
                                Toast.LENGTH_LONG).show();
                        finish();
                    }else if(!nfcAdapter.isEnabled()){
                        Toast.makeText(this,
                                "NFC NOT Enabled!",
                                Toast.LENGTH_LONG).show();
                        finish();
                    }


                                                         - 134 -
   129   130   131   132   133   134   135   136   137   138   139