Android ilovasiga yorliq qo'shib qo'ydi

Men o'qituvchini http://developer.android.com/ resurslar/darsliklar/views/hello-tabwidget.html shundan kelib chiqib, mening kodimga ko'ra, har bir faoliyat manifest va o'z sinfida o'z arizasiga ega.

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class PetCareActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        TextView textview = new TextView(this);
        textview.setText("This is the Pet Care tab");
        setContentView(textview);
    }
}

The problem is at this point, I can only do things like creating textView. How would I add extra content within the tab, similar to https://market.android.com/details?id=com.bskyb.sportnews&hl=en

Rahmat,

Dovud

0

1 javoblar

Oddiy. Mavzu manba identifikatorini setContentView ga o'tkazasiz.

1
qo'shib qo'ydi
Shunday qilib, tab ichida chiziqli jadvalni qo'shishni xohlasam, keyin o'sha chiziqli tugmani bosib tugmalarini bosmoqchi bo'lsam, unda bu kodni qaerga qo'yishim kerak? xml faylida yoki ichida va mening setContentView-ga yuborish uchun havola?
qo'shib qo'ydi muallif david99world, manba
xml faylini ishlatish
qo'shib qo'ydi muallif user999717, manba