Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package co.ortizol.u4s3c5ex2tiendamultimedia;
- import android.support.design.widget.TabLayout;
- import android.support.v4.view.ViewPager;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.support.v7.widget.Toolbar;
- import co.ortizol.u4s3c5ex2tiendamultimedia.adapters.MultimediaTabsAdapter;
- public class MainActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar tbrPrincipal = (Toolbar) findViewById(R.id.tbrPrincipal);
- setSupportActionBar(tbrPrincipal);
- TabLayout tblSeccionesMultimedia = (TabLayout) findViewById(R.id.tblSeccionesMultimedia);
- ViewPager vprMultimedia = (ViewPager) findViewById(R.id.vprMultimedia);
- if(vprMultimedia != null){
- vprMultimedia.setAdapter(new MultimediaTabsAdapter(getSupportFragmentManager(), this));
- }
- if(tblSeccionesMultimedia != null){
- tblSeccionesMultimedia.setupWithViewPager(vprMultimedia, true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement