Android Open Source - inbox-android Sample Menu Activity






From Project

Back to project page inbox-android.

License

The source code is released under:

MIT License

If you think the Android project inbox-android 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.inboxapp.androidsdk.sample_application;
/*w  w  w  .j a  v  a2 s  . c  o  m*/
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.app.ListFragment;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.inboxapp.androidsdk.R;
import com.inboxapp.androidsdk.sample_application.SampleArrayAdapter;
import com.inboxapp.androidsdk.sample_application.SampleDetailsActivity;


public class SampleMenuActivity extends Activity{

    public static final String CATEGORY_TITLE = "CatgoryTitle";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sample);

        FragmentManager fm = getFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        SampleListFragment llf = new SampleListFragment();

            ft.replace(R.id.listFragment, llf);
            ft.commit();

    }

    public static class SampleListFragment extends ListFragment
    {



        String[] category_titles;
        @Override
        public void onListItemClick(ListView l, View v, int position, long id) {
            Context outerContext = getActivity();
            Log.w("Position", "Position Clicked: " + position);
            Intent detailsPageIntent = new Intent(outerContext, SampleDetailsActivity.class);
            detailsPageIntent.putExtra(CATEGORY_TITLE, category_titles[position]);
            startActivity(detailsPageIntent);
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
          category_titles = new String[] {
                    getActivity().getResources().getString(R.string.namespaces),
                    getActivity().getResources().getString(R.string.tags),
                    getActivity().getResources().getString(R.string.threads),
                    getActivity().getResources().getString(R.string.messages),
                    getActivity().getResources().getString(R.string.contacts),
                    getActivity().getResources().getString(R.string.files),
                    getActivity().getResources().getString(R.string.drafts),
                    getActivity().getResources().getString(R.string.test)};
            SampleArrayAdapter adapter = new SampleArrayAdapter(
                    inflater.getContext(), category_titles, true, null);
            setListAdapter(adapter);
            return super.onCreateView(inflater, container, savedInstanceState);
        }

        @Override
        public void onActivityCreated (Bundle savedInstanceState)
        {
            super.onActivityCreated(savedInstanceState);
            getListView().setDivider(new ColorDrawable(Color.GRAY));
            getListView().setDividerHeight(3);
        }
    }
}




Java Source Code List

com.inboxapp.androidapplication.MainActivity.java
com.inboxapp.androidsdk.apis.InboxAppClient.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskCallback.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskQueue.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxTaskID.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateCustomTagTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithIDTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.UpdateThreadTagsTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.base.InboxAppTask.java
com.inboxapp.androidsdk.json_objects.collection_objects.ContactList.java
com.inboxapp.androidsdk.json_objects.collection_objects.DraftList.java
com.inboxapp.androidsdk.json_objects.collection_objects.FileList.java
com.inboxapp.androidsdk.json_objects.collection_objects.MessageList.java
com.inboxapp.androidsdk.json_objects.collection_objects.NameSpaceList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ParticipantList.java
com.inboxapp.androidsdk.json_objects.collection_objects.TagList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ThreadList.java
com.inboxapp.androidsdk.json_objects.single_objects.Contact.java
com.inboxapp.androidsdk.json_objects.single_objects.Draft.java
com.inboxapp.androidsdk.json_objects.single_objects.File.java
com.inboxapp.androidsdk.json_objects.single_objects.Message.java
com.inboxapp.androidsdk.json_objects.single_objects.Namespace.java
com.inboxapp.androidsdk.json_objects.single_objects.Participant.java
com.inboxapp.androidsdk.json_objects.single_objects.Tag.java
com.inboxapp.androidsdk.json_objects.single_objects.Thread.java
com.inboxapp.androidsdk.json_objects.single_objects.base.InboxAppSingleObject.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.DraftID.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagEdit.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagName.java
com.inboxapp.androidsdk.sample_application.SampleArrayAdapter.java
com.inboxapp.androidsdk.sample_application.SampleDetailsActivity.java
com.inboxapp.androidsdk.sample_application.SampleMenuActivity.java
com.inboxapp.androidsdk.scratchpad.Scratchpad_MainActivity.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.JacksonContributor.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.TestApi.java
com.inboxapp.androidsdk.utils.InboxAppStringUtils.java