Hirdetés
Ú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
- Autós topik
- E-roller topik
- Hogyan verte le egy telefon chip az egész laptop ipart? – x86 vs ARM
- Pebble - az átgondolt okosóra
- Battlefield 6
- Xiaomi 17 Ultra - jó az optikája
- Lassan küszöbön a NTE: Neverness to Everness premierje
- Motoros topic
- Kamionok, fuvarozás, logisztika topik
- Google Pixel 9 Pro XL - hét szűk esztendő
- További aktív témák...
- BESZÁMÍTÁS! MSI B650 R7 8700F 64GB DDR5 512GB SSD RX 7700 XT 12GB LIAN LI LANCOOL 217 FSP 650W
- BESZÁMÍTÁS! ASUS B550M R7 5700X 16GB DDR4 512GB SSD RTX 3070 8GB Aerocool P500B Digi ARGB 750W
- BESZÁMÍTÁS! Asrock B450M R7 2700 16GB DDR4 512GB SSD GTX 1660 Super 6GB ZALMAN S4 FSP 500W
- BESZÁMÍTÁS! Asus Z390 i7 9700 32GB DDR4 512GB SSD RTX 2070 Super 8GB Phanteks Eclipse P360A 650W
- BESZÁMÍTÁS! ASRock A520M R5 3600 16GB DDR4 512GB SSD RTX 2060 Super 8GB DarkFlash DK352 Plus 500W
- ÁRGARANCIA!Épített KomPhone i9 14900KF 32/64GB DDR5 RAM RX 9070 XT 16GB GAMER PC termékbeszámítással
- HP 150W töltők (19.5V 7.7A) kis kék, kerek, 4.5x3.0mm
- HIBÁTLAN iPhone 13 Mini 256GB Red -1 ÉV GARANCIA - Kártyafüggetlen, MS4428
- Gamer PC - Számítógép // i7 // GTX 1060 // Számla // Garancia //
- BOMBA ÁRrR! Lenovo ThinkPad T14 Gen 4 Ryzen 5 PRO 7540U 14" FHD+ 32GB 1TB Lenovo gar: 2028.01.07!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

