Not created, no toast is performed
public class MainActivity extends AppCompatActivity { String ip; int port; Socket fromServer; SocketConnectionTask socketConnection; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bundle extras = getIntent().getExtras(); ip = extras.getString("ip"); port = extras.getInt("port"); socketConnection = new SocketConnectionTask(this); socketConnection.execute(ip, String.valueOf(port)); } } class SocketConnectionTask extends AsyncTask<String, Void, Boolean> { Context context; Socket fromServer; public SocketConnectionTask(Context context) { this.context = context; } @Override protected Boolean doInBackground(String... params) { InetAddress address; try { address = InetAddress.getByName(params[0]); } catch (UnknownHostException e) { return false; } try { fromServer = new Socket(address, Integer.parseInt(params[1])); //Тут не переходит на следующие брейкпоиты } catch (IOException e) { return false; //Этот } return true; // И этот } @Override protected void onPostExecute(Boolean aBoolean) { boolean b = aBoolean; Toast.makeText(context, String.valueOf(b), Toast.LENGTH_LONG).show(); } } The server is written in Java . There is also a Java client Java but for some reason it connects to it only on the local network.
catchandreturn truedoes not catch. So debugger doesn’t go beyond socket creation line - Herrgott