Created
July 6, 2014 09:31
-
-
Save gmsetiawan/36541769beeabd1ef194 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package com.example.droidclass; | |
| import android.support.v7.app.ActionBarActivity; | |
| import android.support.v4.app.Fragment; | |
| import android.os.Bundle; | |
| import android.view.LayoutInflater; | |
| import android.view.Menu; | |
| import android.view.MenuItem; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| public class MainActivity extends ActionBarActivity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| if (savedInstanceState == null) { | |
| getSupportFragmentManager().beginTransaction() | |
| .add(R.id.container, new PlaceholderFragment()) | |
| .commit(); | |
| } | |
| } | |
| /** | |
| * A placeholder fragment containing a simple view. | |
| */ | |
| public static class PlaceholderFragment extends Fragment { | |
| public PlaceholderFragment() { | |
| } | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
| Bundle savedInstanceState) { | |
| View rootView = inflater.inflate(R.layout.fragment_main, container, false); | |
| return rootView; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment