Android Open Source - EulerSolutions Problem Solution Activity

From Project

Back to project page EulerSolutions.


The source code is released under:

MIT License

If you think the Android project EulerSolutions 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.eulersolutions.controllers;
//from   ww w .j a  va2  s . c o  m
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.eulersolutions.interfaces.ISelectionListener;
import com.eulersolutions.interfaces.ISolutionDisplay;
import com.eulersolutions.interfaces.ISolutionHandler;

import android.os.Bundle;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;

public class ProblemSolutionActivity extends Activity implements 
  ISelectionListener, ISolutionHandler
  private static final String[] solutionTitles = {"My Solution", "Euler Solution"};
  private static final String TAG = "EulerSolution-ProblemSolutionActivity";
  private ISolutionDisplay solutionDisplay = null;
  private ArrayList<String> solutions = null;

  public static final String MY_SOLUTION_NAME = "mySolution";
  public static final String EULER_SOLUTION_NAME = "eulerSolution";
  protected void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "Entered onCreate");
    solutions = new ArrayList<String>();
    Intent intent = this.getIntent();

  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(, menu);
    return true;

  public void onItemSelected(int position) {
    Log.i(TAG, "Entered onItemSelected");
    if(solutionDisplay != null)

  public List<String> getSolutionTitles() {
    return Arrays.asList(solutionTitles);

  public List<String> getSolutions() {
    return solutions;

  public int numberOfSolutions() {
    return solutions.size();

  public void setSolutionDisplay(ISolutionDisplay newDisplay) {
    solutionDisplay = newDisplay;

Java Source Code List