Browse Source

Version 3 working

ms_service_copie
Miguel Siebenhaar 1 year ago
parent
commit
e54322e3e2
1 changed files with 32 additions and 7 deletions
  1. 32
    7
      app/src/main/java/com/example/ueberwachungssystem/MainActivity.java

+ 32
- 7
app/src/main/java/com/example/ueberwachungssystem/MainActivity.java View File

@@ -12,8 +12,11 @@ import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.example.ueberwachungssystem.Detection.Accelerometer;
@@ -85,13 +88,35 @@ public class MainActivity extends AppCompatActivity {
}
}
});







}else{
Toast.makeText(getApplicationContext(),"Bitte Zugriffsrechte gewähren",Toast.LENGTH_SHORT).show();
}
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.options_menu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this, "Selected Item: " + item.getTitle(), Toast.LENGTH_SHORT).show();
PopUpClass popUpClass;
switch (item.getItemId()) {
case R.id.Rechteverwaltung:
popUpClass = new PopUpClass(MainActivity.this);
popUpClass.showPopupWindow(inputImageView);
popUpClass.RechtePrüfen();
return true;
case R.id.Sensoren:
popUpClass = new PopUpClass(MainActivity.this);
popUpClass.showPopupWindow(inputImageView);
popUpClass.Sensoren();
return true;
case R.id.Impressum:
popUpClass = new PopUpClass(MainActivity.this);
popUpClass.showPopupWindow(inputImageView);
popUpClass.Impressum();
return true;
default:
return super.onOptionsItemSelected(item);
}
}


Loading…
Cancel
Save