Android Open Source - memBitmapTest Start Activity






From Project

Back to project page memBitmapTest.

License

The source code is released under:

GNU General Public License

If you think the Android project memBitmapTest 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.example.membmptest;
//  w w  w  . j  av  a  2s. co  m
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.Toast;

public class StartActivity extends Activity {

    private CheckBox chkLoadResourceAfterCreate;

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

        findViewById(R.id.btnNewActivity).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                start(chkLoadResourceAfterCreate.isChecked());
            }
        });
        chkLoadResourceAfterCreate = (CheckBox) findViewById(R.id.chkLoadResourceAfterCreate);
    }

    private void start(boolean loadAfterCreate) {
        Intent i = new Intent(this, MainActivity.class);

        i.putExtra(BaseMemoryActivity.EXTRA_SET_DRAWABLES_AFTER, loadAfterCreate);
        try {

            startActivity(i);
        } catch (Exception ex) {
            Toast.makeText(this, "Error on activity creation", Toast.LENGTH_SHORT).show();
        }
    }
}




Java Source Code List

com.example.membmptest.BaseMemoryActivity.java
com.example.membmptest.MainActivityFork.java
com.example.membmptest.MainActivity.java
com.example.membmptest.MainApplication.java
com.example.membmptest.StartActivity.java
com.example.membmptest.TestLog.java