Android Question Class or Activity, what is better?

mark35at

Well-Known Member
Licensed User
Maybe a silly question but ...

One app with two activities. The first does lots of things, one of which is taking a screenshot, saving to a file and passing the filename to activity 2. Activity 2 processes the bitmap intensively and returns a list to the first activity.

My question, would activity 2 be better as a class. What benefit would I get from a class?
 

mark35at

Well-Known Member
Licensed User
Yes, the first activity generates the screenshot and the second activity analyses this screenshot and returns data to the first activity which then updates its screen. The second activity is only normally needed once.

I just wondered if there would be any benefit (speed or comfort) from using a class instead of the second activity,as it it really does is maths.

A footnote. When the app is working correctly, the second activity will not even show a screen, just a progress dialog will be shown from activity 1. At present I am showing the calculations on screen for debugging.
 
Top