Displaying multiple activities based on the values calculated on the previous activity in ANDROID STUDIO

  • Replies:1
Subash Mourougayane
  • Forum posts: 1

Jul 21, 2016, 2:00:20 AM via Website

How to Display multiple activities based on the values calculated on the previous activity...
For Example: I've been trying to create an BMI calculator, so now if the calculated value of BMI is in obese range then i need to display a new activity related to obese. And for underweight range another activity have to be displayed. How It is possible in android studio?

Reply
Tommi Chou
  • Forum posts: 6

Aug 4, 2016, 9:19:17 PM via Website

    private void displayActivity( int range )
{
    switch( range )
    {
    case 0 : // obese
        this.startActivity( new Intent( this , ObeseActivity.class ) ) ;
        break ;

    case 1 : // underweight :
        this.startActivity( new Intent( this , UnderweightActivity.class ) ) ;
        break ;
    }
}

Reply