Wednesday 8 November 2017

Data Send in android



integer data send from activity to service

-------------Activity--------------

Intent serviceIntent = new Intent(this, StatusService.class);
serviceIntent.putExtra("QB_Friend_Id",QB_Friend_Id);
startService(serviceIntent);



----------------service-------------------


@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {
    // Let it continue running until it is stopped.
    if (intent != null && intent.getExtras() != null) {
        userID = intent.getIntExtra("QB_Friend_Id", 0);
        Log.v(TAG, "number........." + userID);
    }


No comments:

Post a Comment

AutoComplete Address (Updated)

-------------------------------------Activity---------------------------------- package placeautocomplete.iteritory.com; import androi...