Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7057067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:56:30+00:00 2026-05-28T03:56:30+00:00

I have a program which makes some calculations according to user data. The program

  • 0

I have a program which makes some calculations according to user data.
The program works fine ,but when i try to use achartengine in order to make the plot ,it crashes.(doesn’t do the plot)

I am not sure if i am passing right the data in the LineGraph class.

As i understand i must use

"Bundle sth=getIntent.getExtras()"
but i am not sure where to put it in LineGraph.

I have the number_cores class which in which the user enters the data and then presses the calculate button and in another activity shows the result.
In this , i have :

public void cores_func(){
             double initcores=Double.parseDouble(num_cores.getText().toString().trim());
             double half_time=Double.parseDouble(halftimecores.getText().toString().trim());
             double ttime=Double.parseDouble(timecores.getText().toString().trim());
             double l=Math.log(2)/half_time;
             double fcores=initcores*Math.exp(-l*ttime);
             
             
             Intent i=new Intent(this,core_calcs.class);
             i.putExtra("value",fcores);
             i.putExtra("value2",initcores);
             startActivity(i);  
         }

Then , in the core_calcs class (as you can see from the intent above) , i show the result and also i added a button which when the user clicks it ,shows the graph (right now ,it crashes here).

I have (core_calcs) in the onCreate method :

double fcores=getIntent().getExtras().getDouble("value");
        double initcores=getIntent().getExtras().getDouble("value2");

and then :

 public void onClick(View v) {
    switch (v.getId()){
    case R.id.show_cores_graph:
        double fcores=getIntent().getExtras().getDouble("value");
        double initcores=getIntent().getExtras().getDouble("value2");
        Intent i = new Intent();        
        i.setClassName("com.wordpress.androiddevgeo.Radiation",LineGraph.class.getName());                 
        i.putExtra("value", fcores);
        i.putExtra("value2", initcores);
        this.startActivity(i);  
        break;
      }      
    }

(also, i have the public void LineGraphHandler (View view) here)

Finally , in the LineGraph class (the intent above):

public class LineGraph extends Activity {

public void onCreate(Bundle savedInstanceState){
    
    super.onCreate(savedInstanceState);
    
    Bundle extras=getIntent().getExtras();
    String fcores=extras.getString("value");
    String initcores=extras.getString("value2");
}



public Intent getIntent(Context context){
    
    //double ttime=getIntent(context).getExtras().getDouble("value");
                    
    double [] x = {0,100};           //time axis
    double [] y = {initcores,fcores};  //number of cores axis
    
    TimeSeries series = new TimeSeries("Number of cores");
    for (int i=0;i<x.length;i++){
        series.add(x[i],y[i]);
    }
    
    XYMultipleSeriesDataset dataset=new XYMultipleSeriesDataset();
    dataset.addSeries(series);
    
    XYMultipleSeriesRenderer mRenderer =new XYMultipleSeriesRenderer();
    XYSeriesRenderer renderer =new XYSeriesRenderer();
    mRenderer.addSeriesRenderer(renderer);
    
    Intent intent=ChartFactory.getLineChartIntent(context, dataset, mRenderer,"Decay");
    
    return intent;
    
      }
       }

How to pass the data (initcores and fcores ) to the LineGraph?

——–Error messages ———————————————

W/dalvikvm(734): threadid=3: thread exiting with uncaught exception

(group=0x4000fe70) 01-15 18:42:01.334: E/AndroidRuntime(734): Uncaught
handler: thread main exiting due to uncaught exception

E/AndroidRuntime(734): android.content.ActivityNotFoundException: Unable to find explicit activity class

have you declared this activity in your AndroidManifest.xml?

(I have declared the activity for the LineGraph and also "org.achartengine.GraphicalActivity")
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:56:31+00:00Added an answer on May 28, 2026 at 3:56 am

    Bundle approach:

    Intent searchIntent = new Intent();        
    searchIntent.setClassName("com.mypackage",searrchActivity.class.getName());                 
    searchIntent.putExtra("value", initcores); // key/value pair, where key needs current package prefix.                   
    searchIntent.putExtra("value2", fcores);
    thisactivity.startActivity(searchIntent);  
    

    and in your LineGraph activity:

    class LineGraph extends Activity{
       private Double initcores;
       private Double fcores;
    
       public Double getInitcores(){ return this.initcores;} 
       public void setInitcores(Double initcores){ this.initcores=initcores;} 
       public Double getFcores(){ return this.fcores;} 
       public void setFcores(Double fcores){ this.fcores=fcores;} 
    
    
       public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
        ......
        Bundle extras = getIntent().getExtras(); 
        Double initcores= extras.getDouble("value"); 
        setInitcores(initcores); 
        Double fcores= extras.getDouble("value2"));
        setFcores(fcores);
    
        }
      public Intent getIntent(...){
                      Double initcores= getInitcores();
                      Double fcores= getFcores();
               //yourcode 
      }
    }
    

    SharedPreferences approach:

        SharedPreferences sp =PreferenceManager.getDefaultSharedPreferences(this);      
        SharedPreferences.Editor ed= sp.edit();
        ed.putInt("screen_width", 480);     
        ed.commit();        
    

    and in your next activity

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
        int width = sp.getInt("screen_width",default_int_value);
    

    hope this helps abit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some VB code which makes use of a COM api and results
I have a program which has some Textareas / Labels these can be anywhere
I am making a program which makes use of a couple of constants. At
I wrote a program which solves some kind of optimization problem. I have been
I have a program which needs to behave slightly differently on Tiger than on
I have a program which deliberately performs a divide by zero (and stores the
I have a program which needs installing on windows 64 boxes. Most of the
I have a program which only needs a NotifyIcon to work as intended. So
I have a program which I would like to run every X min the
I have a program which runs an external, command line utility and reads the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.