Open top menu

In this tutorial we will explain how to send String and Array value one activity to another  activity via intent.


   // Sent the String Another Actvity
                        
     Intent intent = new Intent(Menu_Items.this, Bill_Actvity.class);
          //intent.putExtra("<Key>", <String Value>);

           intent.putExtra("Count_Qty", checkedCounter_MyMeal);
   intent.putExtra("Addto_Meal_maxQty_text", Addto_Meal_maxQty);
   intent.putExtra("price", MenuPrice);
   intent.putExtra("dessertitemPrice", strDessertPrice);
           startActivity(intent);
     


 // get the all string via getIntent(); method  
                 
 Intent intent = getIntent();
    String strCounter_MyMeal = intent.getStringExtra("Count_Qty");
    String Addto_Meal_maxQty_text = intent.getStringExtra("Addto_Meal_maxQty_text");
    String menuPrice = intent.getStringExtra("price");
    String strDessertPrice = intent.getStringExtra("dessertitemPrice");



 you have send Array<String> value oneActvity to another Actvity in android.


    Intent intent = new Intent(Menu_Items.this,Bill_Actvity.class);
          intent.putStringArrayListExtra("add_ToMeal", order_itemcomplimentery);           intent.putStringArrayListExtra("add_ToMealprice", AddMeal_pricelist);
  intent.putStringArrayListExtra("dal_subj", order_itemdal);
  intent.putStringArrayListExtra("roti_rice", order_itemdRoti);
  intent.putStringArrayListExtra("dessert", order_itemdessert);
          startActivity(intent);



 Intent intent = getIntent();
               
ArrayList<String>  order_itemcomplimentery = intent.getStringArrayListExtra("add_ToMeal");
ArrayList<String>  AddMeal_pricelist = intent.getStringArrayListExtra("add_ToMealprice"); ArrayList<String>  list_dal = intent.getStringArrayListExtra("dal_subj");   ArrayList<String>  list_roti = intent.getStringArrayListExtra("roti_rice");  
ArrayList<String>  list_dessert = intent.getStringArrayListExtra("dessert");












Tagged

0 comments