Android Open Source - android-process-button Main Activity






From Project

Back to project page android-process-button.

License

The source code is released under:

MIT License

If you think the Android project android-process-button 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.dd.sample;
/* ww  w  . j  a  va 2  s  .c  o  m*/
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        String[] items = getResources().getStringArray(R.array.sample_list);

        ArrayAdapter<String> adapter =
                new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
        setListAdapter(adapter);
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        switch (position) {
            case 0:
                startSignInActivity(false);
                break;
            case 1:
                startSignInActivity(true);
                break;
            case 2:
                startMessageActivity();
                break;
            case 3:
                startUploadActivity();
                break;
            case 4:
                startStateSampleActivity();
                break;
        }
    }

    private void startStateSampleActivity() {
        Intent intent = new Intent(this, StateSampleActivity.class);
        startActivity(intent);
    }

    private void startUploadActivity() {
        Intent intent = new Intent(this, UploadActivity.class);
        startActivity(intent);
    }

    private void startSignInActivity(boolean isEndlessMode) {
        Intent intent = new Intent(this, SignInActivity.class);
        intent.putExtra(SignInActivity.EXTRAS_ENDLESS_MODE, isEndlessMode);
        startActivity(intent);
    }

    private void startMessageActivity() {
        Intent intent = new Intent(this, MessageActivity.class);
        startActivity(intent);
    }
}




Java Source Code List

com.dd.processbutton.FlatButton.java
com.dd.processbutton.ProcessButton.java
com.dd.processbutton.iml.ActionProcessButton.java
com.dd.processbutton.iml.GenerateProcessButton.java
com.dd.processbutton.iml.SubmitProcessButton.java
com.dd.sample.MainActivity.java
com.dd.sample.MessageActivity.java
com.dd.sample.SignInActivity.java
com.dd.sample.StateSampleActivity.java
com.dd.sample.UploadActivity.java
com.dd.sample.utils.ProgressGenerator.java