How Pass Data from Activity to Services in Android?
Contents How Pass Data from Activity to Service in Android? Android Provides a Way to Pass Values Between Activity and Sub-Activities and Services and Each...
Contents
How pass data from activity to service in Android?
Android provides a way to pass values between activity and sub-activities and services and each others, using the getExtras(). putExtra method, which takes the key name (string) and its value. This passed value can be recovered when the intent is handled (being it service or activity).
Must Read
How pass data from activity to adapter using bundle in Android?
Simply add the values to the constructor.
- public SimpleAdapter(Activity context, ArrayList<SimpleBeans> data, String mystring, int myInt){ //use datas here }
- myAdapter = new SimpleAdapter(this, data, myString, myInt);
- myAdapter = new SimpleAdapter(this, myArrayList);