-
-
Save PcNy/befe5465bc7b9008e0b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_user); | |
if (savedInstanceState == null) { | |
getFragmentManager().beginTransaction() | |
.add(R.id.container, new PlaceholderFragment()) | |
.commit(); | |
} | |
} | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.user, menu); | |
return true; | |
} | |
public static class PlaceholderFragment extends Fragment{ | |
private CardArrayAdapter mCardArrayAdapter; | |
private CardListView listView; | |
private ArrayList<Card> cards; | |
public PlaceholderFragment() { | |
} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.fragment_user_n1, container, false); | |
cards = new ArrayList<Card>(); | |
mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards); | |
listView = (CardListView) rootView.findViewById(R.id.userDetailList); | |
if (listView != null){ listView.setAdapter(mCardArrayAdapter); } | |
return rootView; | |
} | |
@Override | |
public void onAttach(Activity activity) { | |
super.onAttach(activity); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment