@Override
protected
void
onCreate(Bundle savedInstanceState) {
super
.onCreate(savedInstanceState);
if
(!isService) {
startService(
new
Intent(pairingActivity.
this
, socketService.
class
));
bindService(
new
Intent(
this
, socketService.
class
), mConnection, Context.BIND_AUTO_CREATE);
isService =
true
;
}
setContentView(R.layout.activity_pairing);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setBackgroundColor(Color.WHITE);
getSupportActionBar().setDisplayHomeAsUpEnabled(
true
);
getSupportActionBar().setDisplayShowTitleEnabled(
false
);
TextView textView = (TextView)findViewById(R.id.textView);
final
Button btn_cancel = (Button) findViewById(R.id.cancel_button_pairing);
final
Button btn_confirm = (Button) findViewById(R.id.cancel_button_confirm);
final
EditText edtTextAddress =
null
, edtTextPort=
null
;
final
Intent intent = getIntent();
wp_id = intent.getStringExtra(
"WP_ID"
);
BUTTON_ID =intent.getStringExtra(
"BTN_ID"
);
wp_role = intent.getStringExtra(
"role"
);
token = FirebaseInstanceId.getInstance().getToken();
mArrayList =
new
ArrayList<>();
GetData1 task =
new
GetData1();
System.out.println(
"Address:"
+mArrayList.size());
final
ConnectivityManager manager;
final
WifiManager wifiManager=(WifiManager)getSystemService(WIFI_SERVICE);
manager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);