Hirdetés
- Google Pixel 9 Pro XL - hét szűk esztendő
- OnePlus 15 - van plusz energia
- Samsung Galaxy S23 Ultra - non plus ultra
- Android alkalmazások - szoftver kibeszélő topik
- CES 2026: Színre lép a Motorola Razr Fold
- MIUI / HyperOS topik
- Amazfit Active 2 NFC - jó kör
- Telekom mobilszolgáltatások
- iPhone topik
- Samsung Galaxy S25 - végre van kicsi!
Új hozzászólás Aktív témák
-
domel
tag
válasz
bucsupeti
#3903
üzenetére
Az sem mindegy?
MainActivity.javapackage com.example.csabi.rohadjmeg;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentTransaction valami;
FragmentTransaction ftc = getSupportFragmentManager().beginTransaction();
BlankFragment fragmentDemo = BlankFragment.newInstance(5, "my title");
ftc.replace(R.id.tvFragText, fragmentDemo);
ftc.commit();
}
}BlankFragment.java
package com.example.csabi.rohadjmeg;
import android.os.Bundle;
import android.support.v4.app.Fragment;
public class BlankFragment extends Fragment {
// Creates a new fragment given an int and title
// DemoFragment.newInstance(5, "Hello");
public static BlankFragment newInstance(int someInt, String someTitle) {
BlankFragment fragmentDemo = new BlankFragment();
Bundle args = new Bundle();
args.putInt("someInt", someInt);
args.putString("someTitle", someTitle);
fragmentDemo.setArguments(args);
return fragmentDemo;
}
}Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:name="com.example.csabi.rohadjmeg.BlankFragment"
android:id="@+id/fooFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Fragment_blank.xml<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="200dp"
android:layout_height="200dp" >
<TextView
android:id="@+id/tvFragText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="" />
</RelativeLayout>
Új hozzászólás Aktív témák
- Apple iPhone 14 Pro Max 256GB Kártya-független,6 Hónap Jótállással Új 100% Akkuval
- Samsung Galaxy S23 Ultra 8/256
- iPad Pro 12.9 (3. gen) 1TB Cellular + Magic Keyboard + Apple Pencil 2
- Apple iPhone 11 Pro Max / 256GB / Kártyafüggetlen / 12Hó Garancia / Akku: 96%
- Apple iPhone 12 Pro / 128GB / Kártyafüggetlen / 12Hó Garancia / Akku: 83%
- PC konfig /Ryzen 7 9800X3D, 32GB RAM, 1TB SSD/ akciós áron eladó! BeszámítOK!
- Apple iPhone 12 Mini 64GB, Kártyafüggetlen, 1 Év Garanciával
- GYÖNYÖRŰ iPhone 12 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3881
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7600X 32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
- Vásárlunk iPhone 12/12 Mini/12 Pro/12 Pro Max
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


