Android Open Source - ISBN-Reporter Entry Point Activity






From Project

Back to project page ISBN-Reporter.

License

The source code is released under:

MIT License

If you think the Android project ISBN-Reporter 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 org.ruboto;
//w  w  w  .j  av  a 2 s.  c o m
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

/**
 * This Activity acts as an entry point to the app.  It must initialize the
 * JRuby runtime before restarting its life cycle.  While JRuby is initializing,
 * a progress dialog is shown.  If R.layout.splash is defined, by adding a
 * res/layout/splash.xml file, this layout is displayed instead of the progress
 * dialog.
 */
public class EntryPointActivity extends org.ruboto.RubotoActivity {

    public void onCreate(Bundle bundle) {
        Log.d("EntryPointActivity onCreate:");

        if (JRubyAdapter.isInitialized()) {
            getScriptInfo().setRubyClassName(getClass().getSimpleName());
        } else {
            showSplash();
            finish();
        }

        super.onCreate(bundle);
    }

    private void showSplash() {
        Intent splashIntent = new Intent(this, SplashActivity.class);
        splashIntent.putExtra(Intent.EXTRA_INTENT, futureIntent());
        startActivity(splashIntent);
    }
    
    // The Intent to to call when done. Defaults to calling this Activity again.
    // Override to change.
    protected Intent futureIntent() {
        if (!getIntent().getAction().equals(Intent.ACTION_VIEW)) {
            return new Intent(getIntent()).setAction(Intent.ACTION_VIEW);
        } else {
            return getIntent();
        }
    }
}




Java Source Code List

org.ruboto.EntryPointActivity.java
org.ruboto.JRubyAdapter.java
org.ruboto.Log.java
org.ruboto.RubotoActivity.java
org.ruboto.RubotoBroadcastReceiver.java
org.ruboto.RubotoComponent.java
org.ruboto.RubotoDialog.java
org.ruboto.RubotoService.java
org.ruboto.ScriptInfo.java
org.ruboto.ScriptLoader.java
org.ruboto.Script.java
org.ruboto.SplashActivity.java
org.ruboto.example.isbn_reporter.IsbnReporterActivity.java