How can I send data from one activity (intent) to another?
I use this code to send data:
Intent i=new Intent(context,SendMessage.class);
i.putExtra(\
This is for adapter , for activity you just need to change mContext to your Activty name and for fragment you need to change mContext to getActivity()
public static ArrayList tags_array ;// static array list if you want to pass array data
public void sendDataBundle(){
tags_array = new ArrayList();
tags_array.add("hashtag");//few array data
tags_array.add("selling");
tags_array.add("cityname");
tags_array.add("more");
tags_array.add("mobile");
tags_array.add("android");
tags_array.add("dress");
Intent su = new Intent(mContext, ViewItemActivity.class);
Bundle bun1 = new Bundle();
bun1.putString("product_title","My Product Titile");
bun1.putString("product_description", "My Product Discription");
bun1.putString("category", "Product Category");
bun1.putStringArrayList("hashtag", tags_array);//to pass array list
su.putExtras(bun1);
mContext.startActivity(su);
}