Anpassung an neue Kommunikation
This commit is contained in:
@@ -60,7 +60,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
//checks that the permission to read and write the xml is granted
|
||||
ensurePermissions();
|
||||
setXML();
|
||||
uebergabe = new Communicator("",8080,this);
|
||||
uebergabe = new Communicator("192.168.1.220",8080,this);
|
||||
setContentView(R.layout.activity_main);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
@@ -21,9 +21,12 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.example.aped.MainActivity;
|
||||
import com.example.aped.R;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AllIOsFragment extends Fragment {
|
||||
@@ -121,6 +124,12 @@ public class AllIOsFragment extends Fragment {
|
||||
imageView.setImageResource(image);
|
||||
TextView_Name.setText(mainActivity.xml.getDeviceNames().get(i));
|
||||
//TextView_State.setText(mainActivity.uebergabe.read(mainActivity.xml.getDeviceNames().get(i)));
|
||||
mainActivity.uebergabe.read(mainActivity.xml.getDeviceNames().get(i), new Response.Listener<JSONObject>() {
|
||||
@Override
|
||||
public void onResponse(JSONObject response) {
|
||||
TextView_State.setText(response.toString());
|
||||
}
|
||||
});
|
||||
ButtonView_Favoriten.setImageResource(favorite_image);
|
||||
return view;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user