Új hozzászólás Aktív témák
-
negyedes
addikt
válasz
WonderCSabo
#893
üzenetére
hat nem, tudom mit masoljak be.

ez a main:
public class MainActivity extends FragmentActivity implements
PatientFrag.OnPatientSelect {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppFolders foldercheck = new AppFolders();
foldercheck.updateExternalStorageState();
foldercheck.updateFolders();
DatabaseHandler db = new DatabaseHandler(this);
db.addPatient(new Patient("Noname1", "10.12.1978", "35", "/sdcard/dicomview/patient/0.dcm" ));
Log.d("Insert: ", "Inserting ..");
setContentView(R.layout.activity_main);
setContentView(R.layout.patient_layout);
// testing if the load is for the first time or a resume
if (findViewById(R.id.patient_list) != null) {
if (savedInstanceState != null) {
return;
}
}
// creating a first instance(pationt)
PatientFrag patientFrag = new PatientFrag();
patientFrag.setArguments(getIntent().getExtras());
// puts the patient_list fragment to the fragmentlayout
getSupportFragmentManager().beginTransaction()
.add(R.id.patient_list, patientFrag).commit();
}
public void patientSelect(int patientPos) {
// find the image fragment
ImageFrag imageFrag = (ImageFrag) getSupportFragmentManager()
.findFragmentById(R.id.image_view);
// verify iff image is opened
if (imageFrag != null) {
// if it is update it
imageFrag.updateImage(patientPos);
} else {
ImageFrag newFrag = new ImageFrag();
Bundle args = new Bundle();
args.putInt(ImageFrag.ARG_POSITION, patientPos);
newFrag.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.replace(R.id.patient_list, newFrag);
transaction.addToBackStack(null);
transaction.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
Új hozzászólás Aktív témák
- Magyar Core I9 Dell Precision 7560 (Core I9 11950h 32Gb 512Gb 4Gb Nvidia) laptopom eladó!
- Új bontatlan ASUS ROG Keris II Origin vezeték nélküli gamer egér Fehér
- PHILIPS 245E1S
- Apple iPhone 13 128Gb, 6 hónap Garancia, Zöld Színben, Kártyafüggetlen, Hátlap törött
- Secretlab Omega gaming chair, gamer szék
- AKCIÓ! 2TB Samsung 980 PRO NVMe SSD meghajtó garanciával hibátlan működéssel
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- HIBÁTLAN iPhone 11 64GB White-1 ÉV GARANCIA - Kártyafüggetlen, MS4389, 100% Akksi
- GAMING PC! i5-12400F / RTX 5060 / 32GB DDR5 / 512GB NVMe / 600w! BeszámítOK
- Dell Latitude 7390 13,3" FHD IPS, i5-i7, 8-16GB RAM, SSD, jó akku, számla, 6 hó gar
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

