|  |  |  | 
|---|
|  |  |  | package com.example.agvcontroller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import android.content.Context; | 
|---|
|  |  |  | import android.content.Intent; | 
|---|
|  |  |  | import android.os.Bundle; | 
|---|
|  |  |  | import android.util.Log; | 
|---|
|  |  |  | import android.view.View; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import androidx.appcompat.app.AppCompatActivity; | 
|---|
|  |  |  | import androidx.recyclerview.widget.LinearLayoutManager; | 
|---|
|  |  |  | 
|---|
|  |  |  | SocketManager socketManager; | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | protected void onCreate(Bundle savedInstanceState) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | super.onCreate(savedInstanceState); | 
|---|
|  |  |  | setContentView(R.layout.activity_start); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | EventBus.getDefault().register(this); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | adapter.setmOnItemClickListener(new ItemAdapter.OnItemClickListener() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void onItemClick(View view, int position) { | 
|---|
|  |  |  | Context context = view.getContext(); | 
|---|
|  |  |  | Intent intent = new Intent(context,MainActivity.class); | 
|---|
|  |  |  | intent.putExtra("message", items.get(position).getIp()); | 
|---|
|  |  |  | startActivityForResult(intent,1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | socketManager = new SocketManager(); | 
|---|
|  |  |  | socketManager.startServer(8080); | 
|---|
|  |  |  | socketManager.startServer(8022); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Subscribe(threadMode = ThreadMode.MAIN) | 
|---|