Android Open Source - Android.Parse Main Activity






From Project

Back to project page Android.Parse.

License

The source code is released under:

MIT License

If you think the Android project Android.Parse listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.iamnbty.android.parse.activity;
/*from   w  ww .j  a va 2  s  .  co m*/
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;

import com.iamnbty.android.parse.R;
import com.iamnbty.android.parse.fragment.AddFriendFragment;
import com.iamnbty.android.parse.fragment.ViewFriendsFragment;


public class MainActivity extends ActionBarActivity {

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.action_add_friend:
                getSupportFragmentManager().beginTransaction().replace(android.R.id.content, new AddFriendFragment()).addToBackStack(null).commit();
                return true;

            case R.id.action_view_friends:
                getSupportFragmentManager().beginTransaction().replace(android.R.id.content, new ViewFriendsFragment()).addToBackStack(null).commit();
                return true;

            default:
                return super.onOptionsItemSelected(item);
        }
    }

}




Java Source Code List

com.iamnbty.android.parse.ApplicationTest.java
com.iamnbty.android.parse.BaseApplication.java
com.iamnbty.android.parse.activity.MainActivity.java
com.iamnbty.android.parse.fragment.AddFriendFragment.java
com.iamnbty.android.parse.fragment.ViewFriendsFragment.java
com.iamnbty.android.parse.parse.FriendParse.java