I can not open the APK normally, but the debugger has no serious problems. I consider that the problem may occur in here.
MainActivity.java:
private TextView text;
public static Toast toast = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text = (TextView) findViewById(R.id.text);
text.setText("IP address : "+getLocalHostIp());
new ServerListener().start();
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity">
<TextView
android:id="@+id/setText"
android:layout_width="match_parent"
android:layout_height="51dp"
android:layout_weight="1" />
</LinearLayout>