Android Open Source - EulerSolutions Main 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  www . j  ava 2s. co  m*/
import com.eulersolutions.controllers.R;
import com.eulersolutions.model.CompletedProblems;
import com.eulersolutions.model.ProblemSummary;

import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class MainActivity extends Activity {

  private static final String TAG = "EulerSolutions-MainActivity";

  protected void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "Entered on Create");
    CompletedProblems problems = new CompletedProblems(this);
    ProblemSelectArrayAdapter problemAdapter = new ProblemSelectArrayAdapter(this, 
        R.layout.layout_problem_select_row,, problems.getCompletedProblems());
    ListView problemListView = (ListView) this.findViewById(;
    problemListView.setOnItemClickListener(new OnItemClickListener(){

      public void onItemClick(AdapterView<?> parent, View view, int position,
          long id) {
        Context context;
        Intent displayProblem;
        ProblemSelectArrayAdapter adapter = (ProblemSelectArrayAdapter) parent.getAdapter();
        ProblemSummary problem = adapter.getItem(position);
        context = adapter.getContext();
        displayProblem = new Intent(context, ProblemPresentationActivity.class);
        displayProblem.putExtra(ProblemPresentationActivity.PARCEL_NAME, problem);

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

Java Source Code List