title: How to pass float from shared preferences and add that to the total?
body: <p>I am fairly new to android development and i have a dilemma. I want to pass a float from another activity that is in shared preferences and add it to the total.</p>
  
  <p>Basically, what i want to do is:</p>
  
  <ol>
  <li>Get the values from Split Activity and pass it to the Main Activity</li>
  <li>total += passed value</li>
  <li>display the total</li>
  <li>save it in shared preferences</li>
  </ol>
  
  <p>And what i have now:</p>
  
  <ol>
  <li>Get the values from Split Activity and pass it to the Main Activity</li>
  <li>it doesn't add in total</li>
  <li>Displays only the passed value. not the total</li>
  </ol>
  
  <p>I have tried implementing a <code>float Total = 0;</code>
  then add the passed valued: <code>Total += passed value</code> 
  But when i display it, it only displays the passed value</p>
  
  <p>All i get is the values are not adding. Which they should. Please enlighten me on this. here are my codes:</p>
  
  <p>Display Bill(Main Activity):</p>
  
  <pre><code>    public void DisplayBill(){
  
      //Retrive Shared Preferences
      SharedPreferences Billing = getApplicationContext().getSharedPreferences("Bill", MODE_PRIVATE);
      float Total = Billing.getFloat("Bill", 0);
  
      final TickerView tickerView = (TickerView) findViewById(R.id.ticker_bill);
      tickerView.setCharacterList(TickerUtils.getDefaultNumberList());
      tickerView.setCharacterList(TickerUtils.getDefaultListForUSCurrency());
  
      tickerView.setText("$".concat(String.valueOf(Total)));
  }
  </code></pre>
  
  <p>Split Bill(Split Activity):</p>
  
  <pre><code>    public void Compute(){
  
      //SHARED PREFERENCE
      SharedPreferences Billing = getApplicationContext().getSharedPreferences("Bill", MODE_PRIVATE);
  
      //CES TICKER
      final TickerView tickerCes = (TickerView) findViewById(R.id.tickerCes);
      tickerCes.setCharacterList(TickerUtils.getDefaultNumberList());
      tickerCes.setCharacterList(TickerUtils.getDefaultListForUSCurrency());
  
      //MON TICKER
      final TickerView tickerMon = (TickerView) findViewById(R.id.tickerMon);
      tickerMon.setCharacterList(TickerUtils.getDefaultNumberList());
      tickerMon.setCharacterList(TickerUtils.getDefaultListForUSCurrency());
  
      EditText edtBill = (EditText) findViewById(R.id.et_bill);
      float Bill = Float.parseFloat(edtBill.getText().toString());
      float SplitBill;
  
      SplitBill = (Bill/2);
  
      tickerCes.setText("$".concat(String.valueOf(SplitBill)));
      tickerMon.setText("$".concat(String.valueOf(SplitBill)));
  
      //Set Shared Preferences
      SharedPreferences.Editor editor = Billing.edit();
      editor.putFloat("Bill",Bill);
      editor.commit();
  
  }
  </code></pre>