Ú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
- BestBuy topik
- Samsung Galaxy A54 - türelemjáték
- Tőzsde és gazdaság
- SSD kibeszélő
- ThinkPad (NEM IdeaPad)
- Házimozi belépő szinten
- EA Sports WRC '23
- Szeged és környéke adok-veszek-beszélgetek
- Képhibák a GeForce-on? Az NVIDIA szerint egy Windows frissítés okozza
- exHWSW - Értünk mindenhez IS
- További aktív témák...
- új 15 hüvelykes MacBook Air M4 256GB SSD sky blue égkék Apple magyar 1 év garancia
- új Harman Kardon Onyx Studio 9 hordozható Bluetooth hangszóró ezüst 1 év garancia
- Seasonic Focus 750W 80 PLUS Gold / Csavarmatricás / BESZÁMÍTÁS OK!
- Inno3D RTX 2070 Twin X2
- Seagate FireCuda 2TB HDD 100% / BESZÁMÍTÁS OK!
- Új Asus Vivobook S16 Flip 2in1 WUXGA X360 Touch i9-13900H 14mag 16GB 1TB SSD Intel Iris XE Garancia
- iKing.hu Honor 200 Pro 512GB Black használt 6 hónap garancia
- HIBÁTLAN iPhone 15 Pro Max 256GB Black Titanium -1 ÉV GARANCIA - Kártyafüggetlen, MS4456
- Törött, Hibás iPhone felvásárlás!!
- Lenovo ThinkPad T14 Gen1 Intel i5-10310U Refurbished - Garancia
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: Laptopműhely Bt.
Város: Budapest

