package com.example.ueberwachungssystem.Fragments; | |||||
import android.content.Context; | |||||
import android.media.Image; | |||||
import android.os.Bundle; | |||||
import android.util.Log; | |||||
import android.view.LayoutInflater; | |||||
import android.view.View; | |||||
import android.view.ViewGroup; | |||||
import android.widget.ImageView; | |||||
import android.widget.ListView; | |||||
import android.widget.TextView; | |||||
import androidx.fragment.app.Fragment; | |||||
import com.example.ueberwachungssystem.MeinAdapter; | |||||
import com.example.ueberwachungssystem.R; | |||||
import java.io.File; | |||||
import java.util.Arrays; | |||||
import java.util.List; | |||||
public class Fragment3 extends Fragment { | |||||
private String text; | |||||
public ImageView ivp; | |||||
private final static String KEY_TEXT = "KEY_TEXT"; | |||||
private void log(String nachricht) { | |||||
Log.d(this.getClass().getSimpleName(), nachricht); | |||||
} | |||||
@Override | |||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) { | |||||
log("onCreateView"); | |||||
View view = inflater.inflate(R.layout.fragment3, container, false); | |||||
ivp = (ImageView) view.findViewById(R.id.Video); | |||||
return view; | |||||
} | |||||
public static Fragment3 erstellen(String text) { | |||||
Fragment3 fragment = new Fragment3(); | |||||
Bundle b = new Bundle(); | |||||
b.putString(KEY_TEXT, text); | |||||
fragment.setArguments(b); | |||||
return fragment; | |||||
} | |||||
@Override | |||||
public void onCreate(Bundle bundle) { | |||||
super.onCreate(bundle); | |||||
Bundle args = getArguments(); | |||||
if (args != null ) { | |||||
text = args.getString(KEY_TEXT); | |||||
log("onCreate: text=" + text); | |||||
} else { | |||||
log("onCreate"); | |||||
} | |||||
} | |||||
} |
import com.example.ueberwachungssystem.Fragments.Fragment1; | import com.example.ueberwachungssystem.Fragments.Fragment1; | ||||
import com.example.ueberwachungssystem.Fragments.Fragment2; | import com.example.ueberwachungssystem.Fragments.Fragment2; | ||||
import com.example.ueberwachungssystem.Detection.DetectorService; | import com.example.ueberwachungssystem.Detection.DetectorService; | ||||
import com.example.ueberwachungssystem.Fragments.Fragment3; | |||||
@ExperimentalGetImage | @ExperimentalGetImage | ||||
public class MainActivity extends AppCompatActivity { | public class MainActivity extends AppCompatActivity { | ||||
private Fragment aktuellesFragment; | private Fragment aktuellesFragment; | ||||
private Fragment1 fragment1; | private Fragment1 fragment1; | ||||
private Fragment2 fragment2; | private Fragment2 fragment2; | ||||
private Fragment3 fragment3; | |||||
private DetectorService detectorService = new DetectorService(); | private DetectorService detectorService = new DetectorService(); | ||||
int num=0; | int num=0; | ||||
//Textviews | //Textviews | ||||
Button button = (Button) view; | Button button = (Button) view; | ||||
zeigeFragment(fragment2.erstellen("Hier stehen dann die Videos")); | zeigeFragment(fragment2.erstellen("Hier stehen dann die Videos")); | ||||
} | } | ||||
public void onClickZeigeFragment3(View view) { | |||||
Button button = (Button) view; | |||||
} | |||||
public void onClickEntferneFragment(View view) { | public void onClickEntferneFragment(View view) { | ||||
entferneFragment(); | entferneFragment(); |
<?xml version="1.0" encoding="utf-8"?> | |||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:gravity="center_horizontal" | |||||
android:orientation="vertical" | |||||
android:background="@color/bluedark"> | |||||
<ImageView | |||||
android:id="@+id/Video" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent"> | |||||
</ImageView> | |||||
</RelativeLayout> |