Passing data between Activity and View class

Shashika

In my android application, I need to pass some data from an Activity class to a View class. But the problem is, I cannot call

protected void onActivityResult(int requestCode, int resultCode, Intent data)

method in View class. Is there another way to do this?

Dixit Patel

In your Extends View Class

1) Declare variable

Bundle bundle=new Bundle();

2) Put This Method

public void setData(Bundle data)
{
   bundle =data;
}

Access from Activity

View mView =new View(YourActivity.this);

mView.setData(new Bundle());

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to transfer data between an Activity and a View class?

From Dev

Android - Passing View from Activity to AsyncTask class

From Java

Passing Data between View Controllers

From Dev

Passing data between view in swift

From Dev

Passing data from activity to swipeable view fragment

From Dev

Xamarin Android passing data from class to activity

From Dev

Passing text view value from adapter class to an activity class

From Dev

Android: Passing value from view class to another activity back and forth

From Dev

Passing data between View Controllers using Segue

From Dev

Passing Data between View Controllers in Swift

From Dev

Passing data between 2 view controllers in Swift

From Dev

Data passing between view controllers not working

From Dev

Passing data between several view controllers

From Dev

Discrepancy passing data between view controllers

From Dev

Swift 3 Passing Data between view Controllers

From Dev

Passing Data between View Controllers without segue

From Dev

Passing data from a class that 'extends activity' to a class that 'extends fragment'

From Dev

Passing ArrayList of objects between activity using Parcelable class

From Dev

Android Java - Passing data between intents but need to save it on main activity

From Dev

IOS Swift - Passing data between view controllers using container view

From Dev

Passing Data between view Controller and a Table View Controller

From Dev

Passing dataset between activity in MPAndroidChart

From Dev

Passing data from Activity to Fragment (by accessing activity from fragment) giving Class Cast Exception

From Dev

Passing data from Activity to Fragment (by accessing activity from fragment) giving Class Cast Exception

From Dev

Class to Activity passing ArrayList values

From Dev

Passing Data in Swift Between View Controllers in Same File

From Dev

Passing data between View Controllers in Swift (From TableView to DetailViewController)

From Dev

Passing data between controller and view with strongly typed model

From Dev

Data passing between two View Controller Swift IOS

Related Related

  1. 1

    How to transfer data between an Activity and a View class?

  2. 2

    Android - Passing View from Activity to AsyncTask class

  3. 3

    Passing Data between View Controllers

  4. 4

    Passing data between view in swift

  5. 5

    Passing data from activity to swipeable view fragment

  6. 6

    Xamarin Android passing data from class to activity

  7. 7

    Passing text view value from adapter class to an activity class

  8. 8

    Android: Passing value from view class to another activity back and forth

  9. 9

    Passing data between View Controllers using Segue

  10. 10

    Passing Data between View Controllers in Swift

  11. 11

    Passing data between 2 view controllers in Swift

  12. 12

    Data passing between view controllers not working

  13. 13

    Passing data between several view controllers

  14. 14

    Discrepancy passing data between view controllers

  15. 15

    Swift 3 Passing Data between view Controllers

  16. 16

    Passing Data between View Controllers without segue

  17. 17

    Passing data from a class that 'extends activity' to a class that 'extends fragment'

  18. 18

    Passing ArrayList of objects between activity using Parcelable class

  19. 19

    Android Java - Passing data between intents but need to save it on main activity

  20. 20

    IOS Swift - Passing data between view controllers using container view

  21. 21

    Passing Data between view Controller and a Table View Controller

  22. 22

    Passing dataset between activity in MPAndroidChart

  23. 23

    Passing data from Activity to Fragment (by accessing activity from fragment) giving Class Cast Exception

  24. 24

    Passing data from Activity to Fragment (by accessing activity from fragment) giving Class Cast Exception

  25. 25

    Class to Activity passing ArrayList values

  26. 26

    Passing Data in Swift Between View Controllers in Same File

  27. 27

    Passing data between View Controllers in Swift (From TableView to DetailViewController)

  28. 28

    Passing data between controller and view with strongly typed model

  29. 29

    Data passing between two View Controller Swift IOS

HotTag

Archive