SocialFragment

package com.casabolsapunto.sw600.activity.christopher; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.casadebolsa.front_principal.R; /** * Social Networks Fragments */ public class SocialFragment extends Fragment { /** * Key to insert the index page into the mapping of a Bundle. */ private static final String INDEX = "index"; private static final String EMISORA = "emisora"; private int mIndex; private String mEmisora; public SocialFragment() { // Required empty public constructor } public static SocialFragment newInstance(int index, String nameEmisora) { // Instantiate a new fragment SocialFragment fragment = new SocialFragment(); // Save the parameters Bundle bundle = new Bundle(); bundle.putInt(INDEX, index); bundle.putString(EMISORA, nameEmisora); fragment.setArguments(bundle); fragment.setRetainInstance(true); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.mIndex = (getArguments() != null) ? getArguments().getInt(INDEX) : -1; this.mEmisora = (getArguments() != null) ? getArguments().getString(EMISORA) : ""; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_social, container, false); // Show the current page index in the view View includedLayout = rootView.findViewById(R.id.layout_tv_social); ImageView iv = (ImageView) includedLayout.findViewById(R.id.imvTwitter); iv.setImageResource(R.drawable.twitter); TextView tvIndex = (TextView) includedLayout.findViewById(R.id.textViewTabLogin); tvIndex.setText( "$" + mEmisora ); return rootView; } }
Fragmento de redes sociales.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.