Doing calculation after retrieving shared preferences
===

I have an application where it acts somewhat like a savings guider. User key in his target amount and the interval which he wants to achieve that target. The app will only prompt once for the target amount and the interval which are displayed on the next activity as textview and also tells the user the average amount he need to save within the entered interval. the next activity has the calculate button. for example; target amount = $600, interval=10 (can be days/months), need to save = 600/10=60. upon pressing the calculate button after entering the saved amount(eg. $60), the app will then change both target and interval text view to; target = target - saving; and interval = interval - 1; the app will also recalculate the average amount he need to save for the remaining interval. Ive tried doing the codings and calculations but keep having errors/calculations wrong. I removed the codes which make my calculations wrong and now I have errors. Can anybody please help me? Any help will be appreciated alot!

Below are the codes. the variables with the stars around them(mainly "interval", "average", "target") are the one with errors.

    public class SavingsGuiderInsertActivity extends SavingsActivity {
    /** Called when the activity is first created. */
	
	String tag = "Savings Guider";
	EditText savingsEdit;
	DecimalFormat df = new DecimalFormat("#.##");
	
	
	protected void onCreate(Bundle savedInstance) {
	    super.onCreate(savedInstance);
	    setContentView(R.layout.insert);
	    
	    Bundle bundle = getIntent().getExtras();
	    String target= bundle.getString("target");
	    String interval= bundle.getString("interval");
	    TextView targetView;
	    TextView intervalView;
	    TextView averageView;
	    double average = Double.parseDouble(target) / Integer.parseInt(interval);
	    
	    targetView = (TextView)findViewById(R.id.view_target);
	    intervalView = (TextView)findViewById(R.id.view_interval);
				
		targetView.setText("$" + target);
		intervalView.setText("" + interval);
		
		averageView = (TextView)findViewById(R.id.viewAverage);
		averageView.setText("You must save $" + df.format(average) + " within the specified time!");
		
		savingsEdit=(EditText)findViewById(R.id.edit_saving);
		Button calculateBtn = (Button)findViewById(R.id.btn_Calculate);
		calculateBtn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				String savings = savingsEdit.getText().toString();
				if(!savings.equals("")) {
				try {
					double savingsII = Double.parseDouble(savingsEdit.getText().toString());
					double targetII = Double.parseDouble(**target**) - savingsII;
					int intervalII = Integer.parseInt(**interval**) - 1;
					TextView targetViewII = (TextView)findViewById(R.id.view_target);
					TextView intervalViewII = (TextView)findViewById(R.id.view_interval);
					targetViewII.setText("$" + targetII);
					intervalViewII.setText("" + intervalII);
					
					if(savingsII < **average**){
						Context context = getApplicationContext();
                    	CharSequence text = "You fail to save the average amount!";
                    	int duration = Toast.LENGTH_SHORT;
                    	Toast toast = Toast.makeText(context, text, duration);
                    	toast.show();
						}
						else if(savingsII == **average**){
							Context context = getApplicationContext();
	                    	CharSequence text = "You are right on track!";
	                    	int duration = Toast.LENGTH_SHORT;
	                    	Toast toast = Toast.makeText(context, text, duration);
	                    	toast.show();
						}
						else if(savingsII > **average**){
							Context context = getApplicationContext();
	                    	CharSequence text = "Excellent! You saved more than average!";
	                    	int duration = Toast.LENGTH_SHORT;
	                    	Toast toast = Toast.makeText(context, text, duration);
	                    	toast.show();
						}
					
					double averageII = targetII / intervalII;
					TextView averageViewII = (TextView)findViewById(R.id.viewAverage);
					averageViewII.setText("You must save $" + df.format(averageII) + " within the specified time!");
				}
				catch (Exception e) {
						Context context = getApplicationContext();
	                	CharSequence text = "Please enter a valid value!";
	                	int duration = Toast.LENGTH_SHORT;
	                	Toast toast = Toast.makeText(context, text, duration);
	                	toast.show();
					}
				}//end if
				else {
					Context context = getApplicationContext();
                	CharSequence text = "Please enter a value!";
                	int duration = Toast.LENGTH_SHORT;
                	Toast toast = Toast.makeText(context, text, duration);
                	toast.show();
				}
			}
		});

	}
	   
	    

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		Log.d(tag, "In the onDestroy() event");
	}
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		Log.d(tag, "In the onPause() event");
	}
	@Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
		Log.d(tag, "In the onRestart() event");
	}
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		Log.d(tag, "In the onResume() event");
	}
	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
		Log.d(tag, "In the onStart() event");
	}
	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		Log.d(tag, "In the onStop() event");
	}
	

	}